public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/1] i2c: imx: Make SDA actually optional for bus recovering
@ 2023-11-30  9:57 Alexander Stein
  2023-11-30 15:51 ` Uwe Kleine-König
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alexander Stein @ 2023-11-30  9:57 UTC (permalink / raw)
  To: Oleksij Rempel, Andi Shyti, Shawn Guo, Sascha Hauer,
	Fabio Estevam
  Cc: Alexander Stein, Pengutronix Kernel Team, NXP Linux Team,
	linux-i2c, linux-arm-kernel

Both i2c_generic_scl_recovery() and the debug output indicate that SDA is
purely optional for bus recovery. But devm_gpiod_get() never returns NULL
making it mandatory. Fix this my calling devm_gpiod_get_optional instead.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
 drivers/i2c/busses/i2c-imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 1775a79aeba2a..88a053987403c 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -1401,7 +1401,7 @@ static int i2c_imx_init_recovery_info(struct imx_i2c_struct *i2c_imx,
 			PINCTRL_STATE_DEFAULT);
 	i2c_imx->pinctrl_pins_gpio = pinctrl_lookup_state(i2c_imx->pinctrl,
 			"gpio");
-	rinfo->sda_gpiod = devm_gpiod_get(&pdev->dev, "sda", GPIOD_IN);
+	rinfo->sda_gpiod = devm_gpiod_get_optional(&pdev->dev, "sda", GPIOD_IN);
 	rinfo->scl_gpiod = devm_gpiod_get(&pdev->dev, "scl", GPIOD_OUT_HIGH_OPEN_DRAIN);
 
 	if (PTR_ERR(rinfo->sda_gpiod) == -EPROBE_DEFER ||
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/1] i2c: imx: Make SDA actually optional for bus recovering
  2023-11-30  9:57 [PATCH 1/1] i2c: imx: Make SDA actually optional for bus recovering Alexander Stein
@ 2023-11-30 15:51 ` Uwe Kleine-König
  2023-12-03 22:04 ` Andi Shyti
  2023-12-04 11:04 ` Oleksij Rempel
  2 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2023-11-30 15:51 UTC (permalink / raw)
  To: Alexander Stein
  Cc: Oleksij Rempel, Andi Shyti, Shawn Guo, Sascha Hauer,
	Fabio Estevam, linux-arm-kernel, NXP Linux Team,
	Pengutronix Kernel Team, linux-i2c


[-- Attachment #1.1: Type: text/plain, Size: 489 bytes --]

On Thu, Nov 30, 2023 at 10:57:51AM +0100, Alexander Stein wrote:
> Both i2c_generic_scl_recovery() and the debug output indicate that SDA is
> purely optional for bus recovery. But devm_gpiod_get() never returns NULL
> making it mandatory. Fix this my calling devm_gpiod_get_optional instead.

s/my/by/

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/1] i2c: imx: Make SDA actually optional for bus recovering
  2023-11-30  9:57 [PATCH 1/1] i2c: imx: Make SDA actually optional for bus recovering Alexander Stein
  2023-11-30 15:51 ` Uwe Kleine-König
@ 2023-12-03 22:04 ` Andi Shyti
  2023-12-04  8:35   ` Alexander Stein
  2023-12-04 11:04 ` Oleksij Rempel
  2 siblings, 1 reply; 6+ messages in thread
From: Andi Shyti @ 2023-12-03 22:04 UTC (permalink / raw)
  To: Alexander Stein
  Cc: Oleksij Rempel, Shawn Guo, Sascha Hauer, Fabio Estevam,
	Pengutronix Kernel Team, NXP Linux Team, linux-i2c,
	linux-arm-kernel

Hi,

On Thu, Nov 30, 2023 at 10:57:51AM +0100, Alexander Stein wrote:
> Both i2c_generic_scl_recovery() and the debug output indicate that SDA is
> purely optional for bus recovery. But devm_gpiod_get() never returns NULL
> making it mandatory. Fix this my calling devm_gpiod_get_optional instead.
                               ^^^^
as Uwe pointed out, /my/by/.

I think Wolfram can fix this before taking it.

> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>

otherwise:

Reviewed-by: Andi Shyti <andi.shyti@kernel.org>

Andi

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/1] i2c: imx: Make SDA actually optional for bus recovering
  2023-12-03 22:04 ` Andi Shyti
@ 2023-12-04  8:35   ` Alexander Stein
  2023-12-19 17:17     ` Wolfram Sang
  0 siblings, 1 reply; 6+ messages in thread
From: Alexander Stein @ 2023-12-04  8:35 UTC (permalink / raw)
  To: Andi Shyti
  Cc: Oleksij Rempel, Shawn Guo, Sascha Hauer, Fabio Estevam,
	Pengutronix Kernel Team, NXP Linux Team, linux-i2c,
	linux-arm-kernel

Hi,

Am Sonntag, 3. Dezember 2023, 23:04:44 CET schrieb Andi Shyti:
> Hi,
> 
> On Thu, Nov 30, 2023 at 10:57:51AM +0100, Alexander Stein wrote:
> > Both i2c_generic_scl_recovery() and the debug output indicate that SDA is
> > purely optional for bus recovery. But devm_gpiod_get() never returns NULL
> > making it mandatory. Fix this my calling devm_gpiod_get_optional instead.
> 
>                                ^^^^
> as Uwe pointed out, /my/by/.
> 
> I think Wolfram can fix this before taking it.
> 
> > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> 
> otherwise:
> 
> Reviewed-by: Andi Shyti <andi.shyti@kernel.org>

Thanks. Let me know if I should send a v2.

Best regards,
Alexander
-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/1] i2c: imx: Make SDA actually optional for bus recovering
  2023-11-30  9:57 [PATCH 1/1] i2c: imx: Make SDA actually optional for bus recovering Alexander Stein
  2023-11-30 15:51 ` Uwe Kleine-König
  2023-12-03 22:04 ` Andi Shyti
@ 2023-12-04 11:04 ` Oleksij Rempel
  2 siblings, 0 replies; 6+ messages in thread
From: Oleksij Rempel @ 2023-12-04 11:04 UTC (permalink / raw)
  To: Alexander Stein
  Cc: Andi Shyti, Shawn Guo, Sascha Hauer, Fabio Estevam,
	Pengutronix Kernel Team, NXP Linux Team, linux-i2c,
	linux-arm-kernel

On Thu, Nov 30, 2023 at 10:57:51AM +0100, Alexander Stein wrote:
> Both i2c_generic_scl_recovery() and the debug output indicate that SDA is
> purely optional for bus recovery. But devm_gpiod_get() never returns NULL
> making it mandatory. Fix this my calling devm_gpiod_get_optional instead.
> 
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>

Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de>
Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>

> ---
>  drivers/i2c/busses/i2c-imx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
> index 1775a79aeba2a..88a053987403c 100644
> --- a/drivers/i2c/busses/i2c-imx.c
> +++ b/drivers/i2c/busses/i2c-imx.c
> @@ -1401,7 +1401,7 @@ static int i2c_imx_init_recovery_info(struct imx_i2c_struct *i2c_imx,
>  			PINCTRL_STATE_DEFAULT);
>  	i2c_imx->pinctrl_pins_gpio = pinctrl_lookup_state(i2c_imx->pinctrl,
>  			"gpio");
> -	rinfo->sda_gpiod = devm_gpiod_get(&pdev->dev, "sda", GPIOD_IN);
> +	rinfo->sda_gpiod = devm_gpiod_get_optional(&pdev->dev, "sda", GPIOD_IN);
>  	rinfo->scl_gpiod = devm_gpiod_get(&pdev->dev, "scl", GPIOD_OUT_HIGH_OPEN_DRAIN);
>  
>  	if (PTR_ERR(rinfo->sda_gpiod) == -EPROBE_DEFER ||
> -- 
> 2.34.1
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/1] i2c: imx: Make SDA actually optional for bus recovering
  2023-12-04  8:35   ` Alexander Stein
@ 2023-12-19 17:17     ` Wolfram Sang
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2023-12-19 17:17 UTC (permalink / raw)
  To: Alexander Stein
  Cc: Andi Shyti, Oleksij Rempel, Shawn Guo, Sascha Hauer,
	Fabio Estevam, Pengutronix Kernel Team, NXP Linux Team, linux-i2c,
	linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 871 bytes --]

On Mon, Dec 04, 2023 at 09:35:00AM +0100, Alexander Stein wrote:
> Hi,
> 
> Am Sonntag, 3. Dezember 2023, 23:04:44 CET schrieb Andi Shyti:
> > Hi,
> > 
> > On Thu, Nov 30, 2023 at 10:57:51AM +0100, Alexander Stein wrote:
> > > Both i2c_generic_scl_recovery() and the debug output indicate that SDA is
> > > purely optional for bus recovery. But devm_gpiod_get() never returns NULL
> > > making it mandatory. Fix this my calling devm_gpiod_get_optional instead.
> > 
> >                                ^^^^
> > as Uwe pointed out, /my/by/.
> > 
> > I think Wolfram can fix this before taking it.
> > 
> > > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> > 
> > otherwise:
> > 
> > Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
> 
> Thanks. Let me know if I should send a v2.

I fixed it up and applied to for-next, thanks!


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-12-19 17:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-30  9:57 [PATCH 1/1] i2c: imx: Make SDA actually optional for bus recovering Alexander Stein
2023-11-30 15:51 ` Uwe Kleine-König
2023-12-03 22:04 ` Andi Shyti
2023-12-04  8:35   ` Alexander Stein
2023-12-19 17:17     ` Wolfram Sang
2023-12-04 11:04 ` Oleksij Rempel

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