All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: Andy Shevchenko <andriy.shevchenko@intel.com>,
	Linus Walleij <linus.walleij@linaro.org>
Cc: Peng Fan <peng.fan@nxp.com>, Sudeep Holla <sudeep.holla@arm.com>,
	"Peng Fan (OSS)" <peng.fan@oss.nxp.com>,
	"brgl@bgdev.pl" <brgl@bgdev.pl>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"cristian.marussi@arm.com" <cristian.marussi@arm.com>
Subject: Re: [PATCH] pinctrl: pinconf-generic: check error value EOPNOTSUPP
Date: Fri, 5 Apr 2024 10:46:04 +0100	[thread overview]
Message-ID: <Zg_IXLNPakLmbbc7@bogus> (raw)
In-Reply-To: <DU0PR04MB941777DA29D70013342721A788032@DU0PR04MB9417.eurprd04.prod.outlook.com>

On Fri, Apr 05, 2024 at 02:13:28AM +0000, Peng Fan wrote:
> Hi Andy,
>
> > Subject: Re: [PATCH] pinctrl: pinconf-generic: check error value EOPNOTSUPP
> >
> > On Thu, Apr 04, 2024 at 01:44:50PM +0200, Linus Walleij wrote:
> > > On Mon, Apr 1, 2024 at 4:02 PM Peng Fan (OSS) <peng.fan@oss.nxp.com>
> > wrote:
> > >
> > > > From: Peng Fan <peng.fan@nxp.com>
> > > >
> > > > The SCMI error value SCMI_ERR_SUPPORT maps to linux error value
> > > > '-EOPNOTSUPP', so when dump configs, need check the error value
> > > > EOPNOTSUPP, otherwise there will be log "ERROR READING CONFIG
> > SETTING".
> > > >
> > > > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > > (...)
> > > >                         ret = pin_config_get_for_pin(pctldev, pin, &config);
> > > >                 /* These are legal errors */
> > > > -               if (ret == -EINVAL || ret == -ENOTSUPP)
> > > > +               if (ret == -EINVAL || ret == -ENOTSUPP || ret ==
> > > > + -EOPNOTSUPP)
> > >
> > > TBH it's a bit odd to call an in-kernel API such as
> > > pin_config_get_for_pin() and get -EOPNOTSUPP back. But it's not like I care
> > a lot, so patch applied.
> >
> > Hmm... I would like actually to get this being consistent. The documentation
> > explicitly says that in-kernel APIs uses Linux error code and not POSIX one.
>
> Would you please share me the documentation?
>

+1, I am interested in knowing more about this as I wasn't aware of this.

> >
> > This check opens a Pandora box.
> >
> > FWIW, it just like dozen or so drivers that needs to be fixed, I prefer to have
> > them being moved to ENOTSUPP, rather this patch.
>
> I see many patches convert to use EOPNOTSUPP by checking git log.
>
> And checkpatch.pl reports warning for using ENOTSUPP.
>

Exactly, I do remember changing ENOTSUPP to EOPNOTSUPP based on checkpatch
suggestion. So either the checkpatch.pl or the document you are referring
is inconsistent and needs fixing either way.

--
Regards,
Sudeep

  reply	other threads:[~2024-04-05  9:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-01 14:10 [PATCH] pinctrl: pinconf-generic: check error value EOPNOTSUPP Peng Fan (OSS)
2024-04-04 11:44 ` Linus Walleij
2024-04-04 17:05   ` Andy Shevchenko
2024-04-04 19:03     ` Linus Walleij
2024-04-04 19:23       ` Andy Shevchenko
2024-04-05  0:26         ` Peng Fan
2024-04-05  2:13     ` Peng Fan
2024-04-05  9:46       ` Sudeep Holla [this message]
2024-04-05 15:39         ` Andy Shevchenko
2024-04-05 15:38       ` Andy Shevchenko
2024-04-05 15:47         ` Sudeep Holla
2024-04-05 15:55           ` Andy Shevchenko
2024-04-05 16:07             ` Sudeep Holla
2024-04-05 16:20               ` Andy Shevchenko
2024-04-05 16:06           ` Cristian Marussi
2024-04-05 16:16             ` Andy Shevchenko
2024-04-05 16:23               ` Cristian Marussi
2024-04-05 16:27                 ` 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=Zg_IXLNPakLmbbc7@bogus \
    --to=sudeep.holla@arm.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=brgl@bgdev.pl \
    --cc=cristian.marussi@arm.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=peng.fan@oss.nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.