[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<DU0PR04MB941777DA29D70013342721A788032@DU0PR04MB9417.eurprd04.prod.outlook.com>
Date: Fri, 5 Apr 2024 02:13:28 +0000
From: Peng Fan <peng.fan@....com>
To: Andy Shevchenko <andriy.shevchenko@...el.com>, Linus Walleij
<linus.walleij@...aro.org>
CC: "Peng Fan (OSS)" <peng.fan@....nxp.com>, "brgl@...ev.pl" <brgl@...ev.pl>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"cristian.marussi@....com" <cristian.marussi@....com>, "sudeep.holla@....com"
<sudeep.holla@....com>
Subject: RE: [PATCH] pinctrl: pinconf-generic: check error value EOPNOTSUPP
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@....nxp.com>
> wrote:
> >
> > > From: Peng Fan <peng.fan@....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@....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?
>
> 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.
BTW: is there any issue if using EOPNOTSUPP here?
Thanks,
Peng.
>
> --
> With Best Regards,
> Andy Shevchenko
>
Powered by blists - more mailing lists