From: Axel Lin <axel.lin@ingics.com>
To: Linus Walleij <linus.walleij@stericsson.com>,
Grant Likely <grant.likely@linaro.org>
Cc: Tomoya MORINAGA <tomoya.rohm@gmail.com>,
Denis Turischev <denis@compulab.co.il>,
Lars Poeschel <poeschel@lemonage.de>,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] gpio: Don't override the error code in probe error handling
Date: Sun, 19 May 2013 14:00:47 +0800 [thread overview]
Message-ID: <1368943247.3455.6.camel@phoenix> (raw)
In-Reply-To: <1368943117.3455.4.camel@phoenix>
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>
---
drivers/gpio/gpio-ml-ioh.c | 3 +--
drivers/gpio/gpio-pch.c | 3 +--
drivers/gpio/gpio-sch.c | 6 ++----
drivers/gpio/gpio-viperboard.c | 3 ++-
4 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/gpio/gpio-ml-ioh.c b/drivers/gpio/gpio-ml-ioh.c
index b733665..0966f26 100644
--- a/drivers/gpio/gpio-ml-ioh.c
+++ b/drivers/gpio/gpio-ml-ioh.c
@@ -496,8 +496,7 @@ err_irq_alloc_descs:
err_gpiochip_add:
while (--i >= 0) {
chip--;
- ret = gpiochip_remove(&chip->gpio);
- if (ret)
+ if (gpiochip_remove(&chip->gpio))
dev_err(&pdev->dev, "Failed gpiochip_remove(%d)\n", i);
}
kfree(chip_save);
diff --git a/drivers/gpio/gpio-pch.c b/drivers/gpio/gpio-pch.c
index cdf5996..0fec097 100644
--- a/drivers/gpio/gpio-pch.c
+++ b/drivers/gpio/gpio-pch.c
@@ -424,8 +424,7 @@ end:
err_request_irq:
irq_free_descs(irq_base, gpio_pins[chip->ioh]);
- ret = gpiochip_remove(&chip->gpio);
- if (ret)
+ if (gpiochip_remove(&chip->gpio))
dev_err(&pdev->dev, "%s gpiochip_remove failed\n", __func__);
err_gpiochip_add:
diff --git a/drivers/gpio/gpio-sch.c b/drivers/gpio/gpio-sch.c
index 1e4de16..5af6571 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));
diff --git a/drivers/gpio/gpio-viperboard.c b/drivers/gpio/gpio-viperboard.c
index 095ab14..5ac2919 100644
--- a/drivers/gpio/gpio-viperboard.c
+++ b/drivers/gpio/gpio-viperboard.c
@@ -446,7 +446,8 @@ static int vprbrd_gpio_probe(struct platform_device *pdev)
return ret;
err_gpiob:
- ret = gpiochip_remove(&vb_gpio->gpioa);
+ if (gpiochip_remove(&vb_gpio->gpioa))
+ dev_err(&pdev->dev, "%s gpiochip_remove failed\n", __func__);
err_gpioa:
return ret;
--
1.8.1.2
next prev parent reply other threads:[~2013-05-19 6:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-19 5:58 [PATCH 1/2] pinctrl: Don't override the error code in probe error handling Axel Lin
2013-05-19 6:00 ` Axel Lin [this message]
2013-05-20 18:28 ` [PATCH 2/2] gpio: " Linus Walleij
2013-05-19 7:54 ` [PATCH 1/2] pinctrl: " Tony Prisk
2013-05-21 7:31 ` Maxime Ripard
2013-05-21 11:31 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1368943247.3455.6.camel@phoenix \
--to=axel.lin@ingics.com \
--cc=denis@compulab.co.il \
--cc=grant.likely@linaro.org \
--cc=linus.walleij@stericsson.com \
--cc=linux-kernel@vger.kernel.org \
--cc=poeschel@lemonage.de \
--cc=tomoya.rohm@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.