9
0
Fork 0

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>
This commit is contained in:
Raphaël Poggi 2014-09-08 15:07:56 +02:00 committed by Sascha Hauer
parent 97323085a5
commit 9c885a2a6f
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}