lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aErNT620V2K7lrKX@opensource.cirrus.com>
Date: Thu, 12 Jun 2025 13:51:27 +0100
From: Charles Keepax <ckeepax@...nsource.cirrus.com>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: Richard Fitzgerald <rf@...nsource.cirrus.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        David Rhodes <david.rhodes@...rus.com>, patches@...nsource.cirrus.com,
        linux-sound@...r.kernel.org, linux-gpio@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH 2/2] pinctrl: cirrus: cs42l43: use new GPIO line value
 setter callbacks

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@...nsource.cirrus.com> wrote:
> >
> > On Thu, Jun 12, 2025 at 02:19:54PM +0200, Bartosz Golaszewski wrote:
> > > From: Bartosz Golaszewski <bartosz.golaszewski@...aro.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@...aro.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@...nsource.cirrus.com>

Thanks,
Charles

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ