From: Wolfram Sang <wsa@kernel.org>
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: Fri, 25 Aug 2023 23:07:15 +0200 [thread overview]
Message-ID: <ZOkYA9UO6nDqQD3h@shikoro> (raw)
In-Reply-To: <20230821032914.1976317-1-ruanjinjie@huawei.com>
[-- Attachment #1.1: Type: text/plain, Size: 993 bytes --]
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>
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
prev parent reply other threads:[~2023-08-25 21:08 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
2023-08-24 16:17 ` Andi Shyti
2023-08-25 21:07 ` Wolfram Sang [this message]
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=ZOkYA9UO6nDqQD3h@shikoro \
--to=wsa@kernel.org \
--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