Re: gpiolib: why does gpio_set_bias() suppress ENOTSUPP?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 4, 2022 at 1:06 PM Kent Gibson <warthog618@xxxxxxxxx> wrote:
> On Mon, Apr 04, 2022 at 12:23:18PM +0300, Andy Shevchenko wrote:
> > On Sun, Apr 3, 2022 at 6:34 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
> > > On 4/2/22 03:45, Kent Gibson wrote:
> > > > On Fri, Apr 01, 2022 at 12:36:57PM +0200, Hans de Goede wrote:

...

> > > > Probably best to extend the uAPI to add a strict mode and leave
> > > > existing usage unchanged.
> > >
> > > Agreed, adding a strict mode to the uAPI seems best.
> > >
> > > And if you do it this way, you should probably also make
> > > the kernel log (using a ratelimited log function) why (e.g.
> > > bias setting not supported)  the call is failing since errno is
> > > not going to tell the user enough here I think.
> >
> > ...which reminds me this one: https://lwn.net/Articles/657341/
> >
>
> In this case I'd be more inclined to return a sanitised config along
> with the error code.  So the user gets "the config you requested isn't
> doable, but this one is". They could even repeat the request with the
> sanitised config, though I'm not sure if that would provide any benefit
> compared to just not requesting strict in the first place.

Yeah, being "too smart" sometimes becomes an evil result.

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux