[PATCH 4/4] pinctrl: AT91: use alias_idx to calculate the base gpio number
Sascha Hauer
s.hauer at pengutronix.de
Mon Sep 8 06:23:42 PDT 2014
For the devicetree case alias_idx contains the gpio bank number.
dev->id has no meaning in this case.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
drivers/pinctrl/pinctrl-at91.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index 3c194df..e77c8c4 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -651,7 +651,7 @@ static int at91_gpio_probe(struct device_d *dev)
at91_gpio->chip.ops = &at91_gpio_ops;
at91_gpio->chip.ngpio = MAX_NB_GPIO_PER_BANK;
at91_gpio->chip.dev = dev;
- at91_gpio->chip.base = dev->id * MAX_NB_GPIO_PER_BANK;
+ at91_gpio->chip.base = alias_idx * MAX_NB_GPIO_PER_BANK;
ret = gpiochip_add(&at91_gpio->chip);
if (ret) {
--
2.1.0
More information about the barebox
mailing list