diff options
author | Raphaël Poggi <poggi.raph@gmail.com> | 2014-09-08 15:07:56 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-09-09 08:07:45 +0200 |
commit | 9c885a2a6ff1ad0e4b8acfbb7c149d8b72a347a0 (patch) | |
tree | 26d661653e1e79a06067cf8926d96e447c339169 | |
parent | 97323085a5c88f7c21b62bac06d41869db59fc57 (diff) | |
download | barebox-9c885a2a6ff1ad0e4b8acfbb7c149d8b72a347a0.tar.gz |
pinctrl: at91: fix the pin_to_controller function
Other functions use pin_to_controller to retrieve a at91_gpio_chip structure,
so fix pin_to_controller to return the correct value.
Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/pinctrl/pinctrl-at91.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c index 0b5d943c9e..db802979d7 100644 --- a/drivers/pinctrl/pinctrl-at91.c +++ b/drivers/pinctrl/pinctrl-at91.c @@ -71,11 +71,11 @@ static int gpio_banks; static struct at91_gpio_chip gpio_chip[MAX_GPIO_BANKS]; -static inline void __iomem *pin_to_controller(unsigned pin) +static inline struct at91_gpio_chip *pin_to_controller(unsigned pin) { pin /= MAX_NB_GPIO_PER_BANK; if (likely(pin < gpio_banks)) - return gpio_chip[pin].regbase; + return &gpio_chip[pin]; return NULL; } |