From: Oleksij Rempel <o.rempel@pengutronix.de>
To: Jinjie Ruan <ruanjinjie@huawei.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>,
Andi Shyti <andi.shyti@kernel.org>,
Fabio Estevam <festevam@gmail.com>,
linus.walleij@linaro.org, linux@armlinux.org.uk,
linux-i2c@vger.kernel.org,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Claudiu Beznea <claudiu.beznea@tuxon.dev>,
Codrin Ciubotariu <codrin.ciubotariu@microchip.com>,
Oleksij Rempel <linux@rempel-privat.de>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
linux-arm-kernel@lists.infradead.org,
NXP Linux Team <linux-imx@nxp.com>
Subject: Re: [PATCH -next v3] I2C: Make return value check more accurate and explicit for devm_pinctrl_get()
Date: Thu, 24 Aug 2023 10:34:53 +0200 [thread overview]
Message-ID: <20230824083453.GB31399@pengutronix.de> (raw)
In-Reply-To: <20230821032914.1976317-1-ruanjinjie@huawei.com>
On Mon, Aug 21, 2023 at 11:29:14AM +0800, Jinjie Ruan wrote:
> If pinctrl is not available (thus devm_pinctrl_get() returns NULL) then
> recovery can't work, because we can't switch the I2C pins between the
> I2C controller and GPIO. So, it is quite correct to print
> "can't get pinctrl, bus recovery not supported" because the I2C bus
> can't be recovered without pinctrl.
>
> The PTR_ERR() is also fine - because if pinctrl is not present and
> returns NULL, we'll end up returning zero, which is exactly what we
> want.
>
> However, open code that with a more accurate message will be more explicit
> for NULL case when CONFIG_PINCTRL is not defined.
>
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
> Suggested-by: Russell King (Oracle) <linux@armlinux.org.uk>
> ---
> v3:
> - Split into two if() statements instead of removing the NULL checks.
> - Remove the fix tags.
> - Update the commit title and message.
> - Update to bring the author's name before.
> 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 | 6 +++++-
> drivers/i2c/busses/i2c-imx.c | 6 +++++-
> 2 files changed, 10 insertions(+), 2 deletions(-)
Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
for the i2c-imx.c
Thank you!
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 |
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-08-24 8:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-21 3:29 [PATCH -next v3] I2C: Make return value check more accurate and explicit for devm_pinctrl_get() Jinjie Ruan
2023-08-24 8:34 ` Oleksij Rempel [this message]
2023-08-24 16:17 ` Andi Shyti
2023-08-25 21:07 ` Wolfram Sang
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=20230824083453.GB31399@pengutronix.de \
--to=o.rempel@pengutronix.de \
--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=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux@armlinux.org.uk \
--cc=linux@rempel-privat.de \
--cc=ruanjinjie@huawei.com \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@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