From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Richard Fitzgerald <rf@opensource.cirrus.com>,
Linus Walleij <linus.walleij@linaro.org>,
David Rhodes <david.rhodes@cirrus.com>,
patches@opensource.cirrus.com, linux-sound@vger.kernel.org,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: Re: [PATCH 2/2] pinctrl: cirrus: cs42l43: use new GPIO line value setter callbacks
Date: Thu, 12 Jun 2025 13:51:27 +0100 [thread overview]
Message-ID: <aErNT620V2K7lrKX@opensource.cirrus.com> (raw)
In-Reply-To: <CAMRc=MeSTN51Zjn5Ou9+bbSwS6skPvHh-eGC4Zs9j0uCu=B9Bg@mail.gmail.com>
On Thu, Jun 12, 2025 at 02:45:45PM +0200, Bartosz Golaszewski wrote:
> On Thu, Jun 12, 2025 at 2:36 PM Charles Keepax
> <ckeepax@opensource.cirrus.com> wrote:
> >
> > On Thu, Jun 12, 2025 at 02:19:54PM +0200, Bartosz Golaszewski wrote:
> > > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > >
> > > struct gpio_chip now has callbacks for setting line values that return
> > > an integer, allowing to indicate failures. Convert the driver to using
> > > them.
> > >
> > > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > > ---
> > > +static int cs42l43_gpio_set(struct gpio_chip *chip, unsigned int offset,
> > > + int value)
> > > {
> > > struct cs42l43_pin *priv = gpiochip_get_data(chip);
> > > unsigned int shift = offset + CS42L43_GPIO1_LVL_SHIFT;
> > > @@ -493,23 +494,27 @@ static void cs42l43_gpio_set(struct gpio_chip *chip, unsigned int offset, int va
> > > offset + 1, str_high_low(value));
> > >
> > > ret = pm_runtime_resume_and_get(priv->dev);
> > > - if (ret) {
> > > - dev_err(priv->dev, "Failed to resume for set: %d\n", ret);
> > > - return;
> > > - }
> > > + if (ret)
> > > + return ret;
> >
> > Is there a reason to lose the error message here? Always nice to
> > know which of the two paths failed when things go bad.
> >
>
> No reason other than being in line with most other drivers which
> typically just return a value without a message. I don't care much, we
> can restore it.
>
I guess it doesn't generally fail, but I am probably more
comfortable leaving it. So lets go with that if you are easy
either way. With that:
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Thanks,
Charles
next prev parent reply other threads:[~2025-06-12 12:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-12 12:19 [PATCH 0/2] pinctrl: cirrus: use new GPIO line value setter callbacks Bartosz Golaszewski
2025-06-12 12:19 ` [PATCH 1/2] pinctrl: cirrus: lochnagar: " Bartosz Golaszewski
2025-06-12 12:34 ` Charles Keepax
2025-06-12 12:19 ` [PATCH 2/2] pinctrl: cirrus: cs42l43: " Bartosz Golaszewski
2025-06-12 12:36 ` Charles Keepax
2025-06-12 12:45 ` Bartosz Golaszewski
2025-06-12 12:51 ` Charles Keepax [this message]
2025-06-18 12:05 ` [PATCH 0/2] pinctrl: cirrus: " Linus Walleij
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=aErNT620V2K7lrKX@opensource.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=bartosz.golaszewski@linaro.org \
--cc=brgl@bgdev.pl \
--cc=david.rhodes@cirrus.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=rf@opensource.cirrus.com \
/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;
as well as URLs for NNTP newsgroup(s).