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] i2c: gpio: fix sda/scl-gpios property support
Date: Wed, 19 Jun 2019 10:49:48 +0200	[thread overview]
Message-ID: <20190619084948.1307-1-m.felsch@pengutronix.de> (raw)

Fix checking the correct pins introduced by commit 5a17fc5863 ("i2c: gpio:
add sda/scl-gpios property support").

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 drivers/i2c/busses/i2c-gpio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c
index 9508adab06..5ab43fe935 100644
--- a/drivers/i2c/busses/i2c-gpio.c
+++ b/drivers/i2c/busses/i2c-gpio.c
@@ -97,7 +97,7 @@ static int of_i2c_gpio_probe(struct device_node *np,
 	pdata->sda_pin = of_get_named_gpio_flags(np, "sda-gpios", 0, NULL);
 	pdata->scl_pin = of_get_named_gpio_flags(np, "scl-gpios", 0, NULL);
 
-	if ((!gpio_is_valid(pdata->sda_pin) || !gpio_is_valid(pdata->sda_pin))
+	if ((!gpio_is_valid(pdata->sda_pin) || !gpio_is_valid(pdata->scl_pin))
 	    && (of_gpio_count(np) >= 2)) {
 		/* Note: The gpios property is marked as deprecated */
 		ret = of_get_gpio(np, 0);
@@ -111,7 +111,7 @@ static int of_i2c_gpio_probe(struct device_node *np,
 		pdata->scl_pin = ret;
 	}
 
-	if (!gpio_is_valid(pdata->sda_pin) || !gpio_is_valid(pdata->sda_pin))
+	if (!gpio_is_valid(pdata->sda_pin) || !gpio_is_valid(pdata->scl_pin))
 		return -ENODEV;
 
 	of_property_read_u32(np, "i2c-gpio,delay-us", &pdata->udelay);
-- 
2.20.1


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

             reply	other threads:[~2019-06-19  8:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19  8:49 Marco Felsch [this message]
2019-06-26  6:42 ` 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=20190619084948.1307-1-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