diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-03-10 19:38:23 +0400 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-03-15 16:33:54 +0400 |
commit | b705c054255ae3264aa02d46347e9cfbcf26523a (patch) | |
tree | c2f379c90d286ebcdac9eaed849f40083dbded23 /drivers/pinctrl/sh-pfc/gpio.c | |
parent | cd3c1beecfeb757b16904386ea474d3c272de4ee (diff) | |
download | linux-b705c054255ae3264aa02d46347e9cfbcf26523a.tar.xz |
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.c | 13 |
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; } |