From 9c885a2a6ff1ad0e4b8acfbb7c149d8b72a347a0 Mon Sep 17 00:00:00 2001 From: Raphaël Poggi Date: Mon, 8 Sep 2014 15:07:56 +0200 Subject: pinctrl: at91: fix the pin_to_controller function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Sascha Hauer --- drivers/pinctrl/pinctrl-at91.c | 4 ++-- 1 file 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; } -- cgit v1.2.3