summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/mvebu
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2017-10-16 14:40:23 +0200
committerLinus Walleij <linus.walleij@linaro.org>2017-10-19 22:32:41 +0200
commit3ee9e605caea401b060a1f9f81343b8bd0952fbd (patch)
tree2ffd92fd57c1971d096af8b0cf7c25623b7b1426 /drivers/pinctrl/mvebu
parent0747c3ecfbed25cb6e31b09a834091757a3ef866 (diff)
pinctrl: armada-37xx: Stop using struct gpio_chip.irq_base
The Armada 37xx driver always initializes the IRQ base to 0, hence the subtraction is a no-op. Remove the subtraction and thereby the last user of struct gpio_chip's .irq_base field. Note that this was also actually a bug and only worked because of the above assumption. If the IRQ base had been dynamically allocated, the subtraction would've caused the wrong mask to be generated since the struct irq_data.hwirq field is an index local to the IRQ domain. As a result, it should now be safe to also allocate this chip's IRQ base dynamically, unless there are consumers left that refer to the IRQs by their global number. Signed-off-by: Thierry Reding <treding@nvidia.com> Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/mvebu')
-rw-r--r--drivers/pinctrl/mvebu/pinctrl-armada-37xx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
index 71b944748304..ac299a6cdfd6 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
@@ -627,14 +627,14 @@ static void armada_37xx_irq_handler(struct irq_desc *desc)
static unsigned int armada_37xx_irq_startup(struct irq_data *d)
{
struct gpio_chip *chip = irq_data_get_irq_chip_data(d);
- int irq = d->hwirq - chip->irq_base;
+
/*
* The mask field is a "precomputed bitmask for accessing the
* chip registers" which was introduced for the generic
* irqchip framework. As we don't use this framework, we can
* reuse this field for our own usage.
*/
- d->mask = BIT(irq % GPIO_PER_REG);
+ d->mask = BIT(d->hwirq % GPIO_PER_REG);
armada_37xx_irq_unmask(d);