mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] i2c: gpio: fix sda/scl-gpios property support
@ 2019-06-19  8:49 Marco Felsch
  2019-06-26  6:42 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Marco Felsch @ 2019-06-19  8:49 UTC (permalink / raw)
  To: barebox

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] i2c: gpio: fix sda/scl-gpios property support
  2019-06-19  8:49 [PATCH] i2c: gpio: fix sda/scl-gpios property support Marco Felsch
@ 2019-06-26  6:42 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2019-06-26  6:42 UTC (permalink / raw)
  To: Marco Felsch; +Cc: barebox

On Wed, Jun 19, 2019 at 10:49:48AM +0200, Marco Felsch wrote:
> 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(-)

Squashed into the original commit, thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-26  6:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-19  8:49 [PATCH] i2c: gpio: fix sda/scl-gpios property support Marco Felsch
2019-06-26  6:42 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox