Re: [PATCH v2 05/15] gpiolib: introduce gpio_chip setters that return values

From: Bartosz Golaszewski
Date: Thu Feb 27 2025 - 09:25:12 EST


On Thu, Feb 27, 2025 at 3:00 PM Marek Szyprowski
<m.szyprowski@xxxxxxxxxxx> wrote:
>
> On 20.02.2025 10:57, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
> >
> > Add new variants of the set() and set_multiple() callbacks that have
> > integer return values allowing to indicate failures to users of the GPIO
> > consumer API. Until we convert all GPIO providers treewide to using
> > them, they will live in parallel to the existing ones.
> >
> > Make sure that providers cannot define both. Prefer the new ones and
> > only use the old ones as fallback.
> >
> > Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
> > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
> > ---
> > lockdep_assert_held(&gc->gpiodev->srcu);
> >
> > - if (WARN_ON(unlikely(!gc->set_multiple && !gc->set)))
> > + if (WARN_ON(unlikely(!gc->set_multiple && !gc->set_multiple_rv)))
> > return -EOPNOTSUPP;
>
> The above change issues a warning on gpio controllers that doesn't
> support set_multiple() callbacks at all. I think that this wasn't intended.
>

Eek, not at all, thanks for the report, I'll fix it.

Bartosz