From: Nicolas Ferre <nicolas.ferre@microchip.com>
To: "Ruan Jinjie" <ruanjinjie@huawei.com>,
linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
"Codrin Ciubotariu" <codrin.ciubotariu@microchip.com>,
"Andi Shyti" <andi.shyti@kernel.org>,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
"Oleksij Rempel" <linux@rempel-privat.de>,
"Pengutronix Kernel Team" <kernel@pengutronix.de>,
"Shawn Guo" <shawnguo@kernel.org>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Fabio Estevam" <festevam@gmail.com>,
"NXP Linux Team" <linux-imx@nxp.com>,
"Wolfram Sang" <wsa@kernel.org>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Yang Li" <leoyang.li@nxp.com>
Subject: Re: [PATCH -next v2] I2C: Fix return value check for devm_pinctrl_get()
Date: Thu, 17 Aug 2023 18:01:59 +0200 [thread overview]
Message-ID: <1098855e-37f4-43fb-5be5-77128d6907fa@microchip.com> (raw)
In-Reply-To: <20230817022018.3527570-1-ruanjinjie@huawei.com>
On 17/08/2023 at 04:20, Ruan Jinjie wrote:
> The devm_pinctrl_get() function returns error pointers and never
> returns NULL. Update the checks accordingly.
>
> Fixes: 543aa2c4da8b ("i2c: at91: Move to generic GPIO bus recovery")
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
> Fixes: fd8961c5ba9e ("i2c: imx: make bus recovery through pinctrl optional")
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
> ---
> v2:
> - Remove NULL check instead of using IS_ERR_OR_NULL() to avoid leaving them behind.
> - Update the commit title and message.
> ---
> drivers/i2c/busses/i2c-at91-master.c | 2 +-
> drivers/i2c/busses/i2c-imx.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-at91-master.c b/drivers/i2c/busses/i2c-at91-master.c
> index 94cff1cd527e..2bf1df5ef473 100644
> --- a/drivers/i2c/busses/i2c-at91-master.c
> +++ b/drivers/i2c/busses/i2c-at91-master.c
> @@ -831,7 +831,7 @@ static int at91_init_twi_recovery_gpio(struct platform_device *pdev,
> struct i2c_bus_recovery_info *rinfo = &dev->rinfo;
>
> rinfo->pinctrl = devm_pinctrl_get(&pdev->dev);
> - if (!rinfo->pinctrl || IS_ERR(rinfo->pinctrl)) {
> + if (IS_ERR(rinfo->pinctrl)) {
> dev_info(dev->dev, "can't get pinctrl, bus recovery not supported\n");
> return PTR_ERR(rinfo->pinctrl);
> }
> diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
> index 10e89586ca72..05d55893f04e 100644
> --- a/drivers/i2c/busses/i2c-imx.c
> +++ b/drivers/i2c/busses/i2c-imx.c
> @@ -1388,7 +1388,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
>
next prev parent reply other threads:[~2023-08-17 16:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-17 2:20 [PATCH -next v2] I2C: Fix return value check for devm_pinctrl_get() Ruan Jinjie
2023-08-17 4:38 ` Oleksij Rempel
2023-08-17 6:58 ` Linus Walleij
2023-08-17 16:01 ` Nicolas Ferre [this message]
2023-08-17 17:30 ` Leo Li
2023-08-17 23:07 ` Yann Sionneau
2023-08-18 1:53 ` Ruan Jinjie
2023-08-18 5:32 ` Sascha Hauer
2023-08-18 7:18 ` Linus Walleij
2023-08-18 7:27 ` Ruan Jinjie
2023-08-18 2:47 ` Ruan Jinjie
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=1098855e-37f4-43fb-5be5-77128d6907fa@microchip.com \
--to=nicolas.ferre@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=andi.shyti@kernel.org \
--cc=claudiu.beznea@tuxon.dev \
--cc=codrin.ciubotariu@microchip.com \
--cc=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=leoyang.li@nxp.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux@rempel-privat.de \
--cc=ruanjinjie@huawei.com \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
--cc=wsa@kernel.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