summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/sh-pfc/gpio.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2013-03-10 16:38:23 +0100
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2013-03-15 13:33:54 +0100
commitb705c054255ae3264aa02d46347e9cfbcf26523a (patch)
treec2f379c90d286ebcdac9eaed849f40083dbded23 /drivers/pinctrl/sh-pfc/gpio.c
parentcd3c1beecfeb757b16904386ea474d3c272de4ee (diff)
downloadblackbird-op-linux-b705c054255ae3264aa02d46347e9cfbcf26523a.tar.gz
blackbird-op-linux-b705c054255ae3264aa02d46347e9cfbcf26523a.zip
sh-pfc: Use proper error codes
Return proper error codes instead of -1, and propagate the error codes. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/sh-pfc/gpio.c')
-rw-r--r--drivers/pinctrl/sh-pfc/gpio.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/pinctrl/sh-pfc/gpio.c b/drivers/pinctrl/sh-pfc/gpio.c
index 480beae2ee67..e299f14bc50a 100644
--- a/drivers/pinctrl/sh-pfc/gpio.c
+++ b/drivers/pinctrl/sh-pfc/gpio.c
@@ -276,22 +276,17 @@ static int gpio_function_request(struct gpio_chip *gc, unsigned offset)
struct sh_pfc *pfc = gpio_to_pfc(gc);
unsigned int mark = pfc->info->func_gpios[offset].enum_id;
unsigned long flags;
- int ret = -EINVAL;
+ int ret;
pr_notice_once("Use of GPIO API for function requests is deprecated, convert to pinctrl\n");
if (mark == 0)
- return ret;
+ return -EINVAL;
spin_lock_irqsave(&pfc->lock, flags);
-
- if (sh_pfc_config_mux(pfc, mark, PINMUX_TYPE_FUNCTION))
- goto done;
-
- ret = 0;
-
-done:
+ ret = sh_pfc_config_mux(pfc, mark, PINMUX_TYPE_FUNCTION);
spin_unlock_irqrestore(&pfc->lock, flags);
+
return ret;
}
OpenPOWER on IntegriCloud