mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 1/4] gpiolib: fix of_gpio_hog error handling
Date: Thu, 18 Oct 2018 12:43:46 +0200	[thread overview]
Message-ID: <20181018104349.26332-2-m.felsch@pengutronix.de> (raw)
In-Reply-To: <20181018104349.26332-1-m.felsch@pengutronix.de>

Currently the error handling of gpio_get_num() checks the return value
of the previous of_property_read_u32_index() which has it's own error
check. Fix it by using the correct return value variable.

Fixes: 37e6bee7e5 ("gpiolib: Add support for GPIO "hog" nodes")
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 drivers/gpio/gpiolib.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index b83a27de7d..4e0bf73742 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -352,12 +352,12 @@ static int of_hog_gpio(struct device_node *np, struct gpio_chip *chip,
 		flags |= GPIOF_ACTIVE_LOW;
 
 	gpio = gpio_get_num(chip->dev, gpio_num);
-	if (ret == -EPROBE_DEFER)
-		return ret;
+	if (gpio == -EPROBE_DEFER)
+		return gpio;
 
-	if (ret < 0) {
+	if (gpio < 0) {
 		dev_err(chip->dev, "unable to get gpio %u\n", gpio_num);
-		return ret;
+		return gpio;
 	}
 
 
-- 
2.19.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2018-10-18 10:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-18 10:43 [PATCH 0/4] gpio-hog fixes Marco Felsch
2018-10-18 10:43 ` Marco Felsch [this message]
2018-10-18 10:43 ` [PATCH 2/4] gpiolib: fix of_hog_gpio gpio label assignment Marco Felsch
2018-10-18 10:43 ` [PATCH 3/4] gpio: tree-wide don't probe devices during core_initcall Marco Felsch
2018-10-18 10:43 ` [PATCH 4/4] pinctrl: tree-wide " Marco Felsch
2018-10-19 12:19 ` [PATCH 0/4] gpio-hog fixes Sascha Hauer

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=20181018104349.26332-2-m.felsch@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=barebox@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox