diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-03-10 11:38:23 -0400 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-03-15 08:33:54 -0400 |
commit | b705c054255ae3264aa02d46347e9cfbcf26523a (patch) | |
tree | c2f379c90d286ebcdac9eaed849f40083dbded23 /drivers/pinctrl/sh-pfc/gpio.c | |
parent | cd3c1beecfeb757b16904386ea474d3c272de4ee (diff) |
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) | |||
276 | struct sh_pfc *pfc = gpio_to_pfc(gc); | 276 | struct sh_pfc *pfc = gpio_to_pfc(gc); |
277 | unsigned int mark = pfc->info->func_gpios[offset].enum_id; | 277 | unsigned int mark = pfc->info->func_gpios[offset].enum_id; |
278 | unsigned long flags; | 278 | unsigned long flags; |
279 | int ret = -EINVAL; | 279 | int ret; |
280 | 280 | ||
281 | pr_notice_once("Use of GPIO API for function requests is deprecated, convert to pinctrl\n"); | 281 | pr_notice_once("Use of GPIO API for function requests is deprecated, convert to pinctrl\n"); |
282 | 282 | ||
283 | if (mark == 0) | 283 | if (mark == 0) |
284 | return ret; | 284 | return -EINVAL; |
285 | 285 | ||
286 | spin_lock_irqsave(&pfc->lock, flags); | 286 | spin_lock_irqsave(&pfc->lock, flags); |
287 | 287 | ret = sh_pfc_config_mux(pfc, mark, PINMUX_TYPE_FUNCTION); | |
288 | if (sh_pfc_config_mux(pfc, mark, PINMUX_TYPE_FUNCTION)) | ||
289 | goto done; | ||
290 | |||
291 | ret = 0; | ||
292 | |||
293 | done: | ||
294 | spin_unlock_irqrestore(&pfc->lock, flags); | 288 | spin_unlock_irqrestore(&pfc->lock, flags); |
289 | |||
295 | return ret; | 290 | return ret; |
296 | } | 291 | } |
297 | 292 | ||