summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-sch.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2013-05-19 08:00:47 +0200
committerLinus Walleij <linus.walleij@linaro.org>2013-05-20 20:27:30 +0200
commitcfb10898efe1bc1f3eb8d8f37f164d9e2ac8b43a (patch)
tree4633a990efc5bcd9090bb594acc4a9923a0194cc /drivers/gpio/gpio-sch.c
parentgpio: mxs: Use set and clear capabilities of the gpio controller (diff)
downloadlinux-cfb10898efe1bc1f3eb8d8f37f164d9e2ac8b43a.tar.xz
linux-cfb10898efe1bc1f3eb8d8f37f164d9e2ac8b43a.zip
gpio: Don't override the error code in probe error handling
Otherwise, we return 0 in probe error paths when gpiochip_remove() returns 0. Also show error message if gpiochip_remove() fails. Signed-off-by: Axel Lin <axel.lin@ingics.com> Cc: Tomoya MORINAGA <tomoya.rohm@gmail.com> Cc: Denis Turischev <denis@compulab.co.il> Cc: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-sch.c')
-rw-r--r--drivers/gpio/gpio-sch.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpio/gpio-sch.c b/drivers/gpio/gpio-sch.c
index 1e4de16ceb41..5af65719b95d 100644
--- a/drivers/gpio/gpio-sch.c
+++ b/drivers/gpio/gpio-sch.c
@@ -272,10 +272,8 @@ static int sch_gpio_probe(struct platform_device *pdev)
return 0;
err_sch_gpio_resume:
- err = gpiochip_remove(&sch_gpio_core);
- if (err)
- dev_err(&pdev->dev, "%s failed, %d\n",
- "gpiochip_remove()", err);
+ if (gpiochip_remove(&sch_gpio_core))
+ dev_err(&pdev->dev, "%s gpiochip_remove failed\n", __func__);
err_sch_gpio_core:
release_region(res->start, resource_size(res));