From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Linus Walleij <linus.walleij@linaro.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Alban Bedel <albeu@free.fr>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Bartosz Golaszewski <bgolaszewski@baylibre.com>
Subject: [PATCH 1/6] gpio: xgene: remove redundant error message
Date: Wed, 2 Oct 2019 19:02:44 +0200 [thread overview]
Message-ID: <20191002170249.17366-2-brgl@bgdev.pl> (raw)
In-Reply-To: <20191002170249.17366-1-brgl@bgdev.pl>
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
There's no need to emit an error message on probe failure unless we're
printing some meaningful info. Otherwise the core driver code will
inform us about a probe error.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
drivers/gpio/gpio-xgene.c | 23 +++++++----------------
1 file changed, 7 insertions(+), 16 deletions(-)
diff --git a/drivers/gpio/gpio-xgene.c b/drivers/gpio/gpio-xgene.c
index 2918363884de..900b38a7dba8 100644
--- a/drivers/gpio/gpio-xgene.c
+++ b/drivers/gpio/gpio-xgene.c
@@ -160,23 +160,17 @@ static int xgene_gpio_probe(struct platform_device *pdev)
int err = 0;
gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL);
- if (!gpio) {
- err = -ENOMEM;
- goto err;
- }
+ if (!gpio)
+ return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- err = -EINVAL;
- goto err;
- }
+ if (!res)
+ return -EINVAL;
gpio->base = devm_ioremap_nocache(&pdev->dev, res->start,
resource_size(res));
- if (!gpio->base) {
- err = -ENOMEM;
- goto err;
- }
+ if (!gpio->base)
+ return -ENOMEM;
gpio->chip.ngpio = XGENE_MAX_GPIOS;
@@ -196,14 +190,11 @@ static int xgene_gpio_probe(struct platform_device *pdev)
if (err) {
dev_err(&pdev->dev,
"failed to register gpiochip.\n");
- goto err;
+ return err;
}
dev_info(&pdev->dev, "X-Gene GPIO driver registered.\n");
return 0;
-err:
- dev_err(&pdev->dev, "X-Gene GPIO driver registration failed.\n");
- return err;
}
static const struct of_device_id xgene_gpio_of_match[] = {
--
2.23.0
next prev parent reply other threads:[~2019-10-02 17:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-02 17:02 [PATCH 0/6] gpio: replace nocache ioremap functions with devm_platform_ioremap_resource() Bartosz Golaszewski
2019-10-02 17:02 ` Bartosz Golaszewski [this message]
2019-10-02 17:02 ` [PATCH 2/6] gpio: xgene: use devm_platform_ioremap_resource() Bartosz Golaszewski
2019-10-02 17:02 ` [PATCH 3/6] gpio: em: " Bartosz Golaszewski
2019-10-03 7:00 ` Geert Uytterhoeven
2019-10-02 17:02 ` [PATCH 4/6] gpio: ath79: " Bartosz Golaszewski
2019-10-02 17:02 ` [PATCH 5/6] gpio: htc-egpio: " Bartosz Golaszewski
2019-10-02 17:02 ` [PATCH 6/6] gpio: htc-egpio: remove redundant error message Bartosz Golaszewski
2019-10-04 22:12 ` [PATCH 0/6] gpio: replace nocache ioremap functions with devm_platform_ioremap_resource() 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=20191002170249.17366-2-brgl@bgdev.pl \
--to=brgl@bgdev.pl \
--cc=albeu@free.fr \
--cc=bgolaszewski@baylibre.com \
--cc=geert+renesas@glider.be \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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.