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:
parent
97323085a5
commit
9c885a2a6f
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue