[PATCH] i2c: imx: move to generic GPIO recovery

Oleksij Rempel o.rempel at pengutronix.de
Thu Jan 25 22:07:19 PST 2024


Hi,

On Thu, Jan 25, 2024 at 02:56:36PM +0100, Esben Haabendal wrote:
> Starting with
> commit 75820314de26 ("i2c: core: add generic I2C GPIO recovery")
> GPIO bus recovery is supported by the I2C core, so we can remove the
> driver implementation and use that one instead.
> 
> As a nice side-effect, pinctrl becomes optional, allowing bus recovery on
> LS1021A, which does not have such luxury, but can be wired up to use extra
> fixed GPIO pins.
> 
> Note: The previous error messages about bus recovery not being supported is
> dropped with this change. Given that it is perfectly possible to have platforms
> where bus recovery works without pinctrl support, I happen to work on one such,
> both error messages does not really make sense in those cases. And I don't see
> how to know if this is the case or not.
> 
> Signed-off-by: Esben Haabendal <esben at geanix.com>

Thank you for your work.

> ---
....
> +	struct i2c_bus_recovery_info *bri = &i2c_imx->rinfo;
>  
> -	dev_dbg(&pdev->dev, "using scl%s for recovery\n",
> -		rinfo->sda_gpiod ? ",sda" : "");
> +	bri->pinctrl = devm_pinctrl_get(&pdev->dev);
> +	if (IS_ERR(bri->pinctrl))
> +		return PTR_ERR(bri->pinctrl);

According to the commit message - "pinctrl becomes optional", but this
code stops probe if pinctrl will fail for one or another reason. I do
not see any place returning NULL on fail. Do I'm missing something?

Regards,
Oleksij
-- 
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 |



More information about the linux-arm-kernel mailing list