From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Yann Sionneau <ysionneau@kalray.eu>
Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Julian Vetter <jvetter@kalrayinc.com>,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] Currently if the SoC needs pinctrl to switch the SCL and SDA from the I2C function to GPIO function, the recovery won't work.
Date: Tue, 22 Aug 2023 15:06:41 +0300 [thread overview]
Message-ID: <ZOSk0b1wKF/NzCzz@smile.fi.intel.com> (raw)
In-Reply-To: <ZOSj6C+4q/xUNyhA@smile.fi.intel.com>
On Tue, Aug 22, 2023 at 03:02:48PM +0300, Andy Shevchenko wrote:
> On Tue, Aug 22, 2023 at 11:15:55AM +0200, Yann Sionneau wrote:
...
> > + rinfo->pinctrl = devm_pinctrl_get(dev->dev);
> > + if (IS_ERR(rinfo->pinctrl)) {
> > + if (PTR_ERR(rinfo->pinctrl) == -EPROBE_DEFER)
> > + return PTR_ERR(rinfo->pinctrl);
> > +
> > + rinfo->pinctrl = NULL;
> > + dev_err(dev->dev, "getting pinctrl info failed: bus recovery might not work\n");
> > + } else if (!rinfo->pinctrl) {
> > + dev_dbg(dev->dev, "pinctrl is disabled, bus recovery might not work\n");
> > + }
>
> A bit of bikeshedding, would the below be slightly better?
>
> rinfo->pinctrl = devm_pinctrl_get(dev->dev);
> if (IS_ERR(rinfo->pinctrl)) {
> if (PTR_ERR(rinfo->pinctrl) == -EPROBE_DEFER)
> return PTR_ERR(rinfo->pinctrl);
>
> rinfo->pinctrl = NULL;
> dev_err(dev->dev, "getting pinctrl info failed, disabling...\n");
> }
> if (!rinfo->pinctrl)
> dev_dbg(dev->dev, "pinctrl is disabled, bus recovery might not work\n");
On the second thought they are on a different levels... Anyway, up to you,
folks, what to do with that, I gave already my tag.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-08-22 12:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-22 9:15 [PATCH v3] Currently if the SoC needs pinctrl to switch the SCL and SDA from the I2C function to GPIO function, the recovery won't work Yann Sionneau
2023-08-22 12:02 ` Andy Shevchenko
2023-08-22 12:06 ` Andy Shevchenko [this message]
2023-08-22 12:18 ` Yann Sionneau
2023-08-22 12:04 ` Andy Shevchenko
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=ZOSk0b1wKF/NzCzz@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=jvetter@kalrayinc.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=ysionneau@kalray.eu \
/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