sh-pfc: Don't needlessly check GPIO type in sh_gpio_free()
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Thu, 29 Nov 2012 17:00:32 +0000 (18:00 +0100)
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Fri, 15 Mar 2013 12:33:37 +0000 (13:33 +0100)
The GPIO type is always PINMUX_TYPE_FUNCTION when freeing a function
GPIO. Hardcode the type value.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/sh-pfc/gpio.c

index 80a50d8a50e7426ee989587e15aa6d8c5c160ec4..8f01113d0ecbf7a27a8d9f951d5ea7fb2641c7a0 100644 (file)
@@ -71,16 +71,13 @@ static void sh_gpio_free(struct gpio_chip *gc, unsigned offset)
 {
        struct sh_pfc *pfc = gpio_to_pfc(gc);
        unsigned long flags;
-       int pinmux_type;
 
        if (offset < pfc->info->nr_pins)
                return pinctrl_free_gpio(offset);
 
        spin_lock_irqsave(&pfc->lock, flags);
 
-       pinmux_type = pfc->info->gpios[offset].flags & PINMUX_FLAG_TYPE;
-
-       sh_pfc_config_gpio(pfc, offset, pinmux_type, GPIO_CFG_FREE);
+       sh_pfc_config_gpio(pfc, offset, PINMUX_TYPE_FUNCTION, GPIO_CFG_FREE);
 
        spin_unlock_irqrestore(&pfc->lock, flags);
 }