Re: [PATCH 2/3] gpio: at91: Implement ops set_flags

Zixun LI
2024-11-12T18:42:23Z

Hi,

On Tue, Nov 12, 2024 at 2:21 PM Eugen Hristev <eugen.hristev@linaro.org> wrote:
>
> Does this change the current behavior? there is no set_flag ops
> implemented, previously it would use a default that would just return
> success regardless of the given flags parameters ?
> Btw maybe ENOTSUPP ?
>

Currently without .set_flags ops it just returns success regardless of the
given flags parameters. It's problematic especially when pull-up/down is used.
I've another patch to fix the silent failure:
https://lists.denx.de/pipermail/u-boot/2024-October/569044.html

Most drivers just ignore unsupported flags, I copied flag check from mcp230xx
driver. Is it better to return ENOTSUPP instead ?

> > +
> > + if (flags & GPIOD_IS_OUT) {
> > + bool value = flags & GPIOD_IS_OUT_ACTIVE;
>
> Can you please declare this value at the start of the function, or
> inline it below when it's being used
>

Will do.