Re: [PATCH 4/4] i2c: imx: devm_pinctrl_get() cannot return NULL

From: Oleksij Rempel
Date: Thu Aug 17 2023 - 01:10:01 EST


On Wed, Aug 16, 2023 at 10:04:10PM +0200, Yann Sionneau wrote:
> Remove unnecessary check against NULL for devm_pinctrl_get() return value.
>
> Signed-off-by: Yann Sionneau <yann@xxxxxxxxxxxx>
> ---
> drivers/i2c/busses/i2c-imx.c | 2 +-

Acked-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>

Thank you!

> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
> index 65128a73e8a3..502276e8ded5 100644
> --- a/drivers/i2c/busses/i2c-imx.c
> +++ b/drivers/i2c/busses/i2c-imx.c
> @@ -1389,7 +1389,7 @@ static int i2c_imx_init_recovery_info(struct imx_i2c_struct *i2c_imx,
> struct i2c_bus_recovery_info *rinfo = &i2c_imx->rinfo;
>
> i2c_imx->pinctrl = devm_pinctrl_get(&pdev->dev);
> - if (!i2c_imx->pinctrl || IS_ERR(i2c_imx->pinctrl)) {
> + if (IS_ERR(i2c_imx->pinctrl)) {
> dev_info(&pdev->dev, "can't get pinctrl, bus recovery not supported\n");
> return PTR_ERR(i2c_imx->pinctrl);
> }
> --
> 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 |