linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kent Gibson <warthog618@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: Re: gpiolib: why does gpio_set_bias() suppress ENOTSUPP?
Date: Mon, 4 Apr 2022 18:06:02 +0800	[thread overview]
Message-ID: <20220404100602.GC24083@sol> (raw)
In-Reply-To: <CAHp75VcuM2qZjZCkcZ01u=KSqyudMJTB8meORpZ0hxA4_PFg8A@mail.gmail.com>

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@redhat.com> 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.

Cheers,
Kent.

> -- 
> With Best Regards,
> Andy Shevchenko

  reply	other threads:[~2022-04-04 10:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-31  2:52 gpiolib: why does gpio_set_bias() suppress ENOTSUPP? Kent Gibson
2022-03-31 13:53 ` Andy Shevchenko
2022-03-31 14:15   ` Kent Gibson
2022-03-31 17:19     ` Andy Shevchenko
2022-04-01  0:08       ` Kent Gibson
2022-04-01 10:42         ` Andy Shevchenko
2022-04-02  1:45           ` Kent Gibson
2022-04-01 10:36     ` Hans de Goede
2022-04-02  1:45       ` Kent Gibson
2022-04-02  9:11         ` Hans de Goede
2022-04-04  9:23           ` Andy Shevchenko
2022-04-04 10:06             ` Kent Gibson [this message]
2022-04-04 10:16               ` Andy Shevchenko

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=20220404100602.GC24083@sol \
    --to=warthog618@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=brgl@bgdev.pl \
    --cc=hdegoede@redhat.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=thomas.petazzoni@bootlin.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).