public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Michael Walle" <mwalle@kernel.org>
To: "Andy Shevchenko" <andy.shevchenko@gmail.com>,
	<linux-gpio@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: "Linus Walleij" <linus.walleij@linaro.org>,
	"Bartosz Golaszewski" <brgl@bgdev.pl>
Subject: Re: [PATCH v1 1/1] gpio: regmap: Use -ENOTSUPP consistently
Date: Thu, 11 Apr 2024 12:46:32 +0200	[thread overview]
Message-ID: <D0H8EQB97VFA.2P27K85EJXCTB@kernel.org> (raw)
In-Reply-To: <20240410063930.1199355-1-andy.shevchenko@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1526 bytes --]

Hi Andy,

On Wed Apr 10, 2024 at 8:39 AM CEST, Andy Shevchenko wrote:
> The GPIO library expects the drivers to return -ENOTSUPP in some cases
> and not using analogue POSIX code. Make the driver to follow this.

I don't care too much, so if you like you can add

Reviewed-by: Michael Walle <mwalle@kernel.org>

But.. isn't it the wrong errno and isn't it discouraged to use it
because it's a NFS only errno? Thus, wouldn't it make more sense for
the core to accept EOPNOTSUPP and maybe convert it to ENOTSUPP if we
don't want to break userspace?

-michael

> Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> ---
>  drivers/gpio/gpio-regmap.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c
> index c08c8e528867e..71684dee2ca5d 100644
> --- a/drivers/gpio/gpio-regmap.c
> +++ b/drivers/gpio/gpio-regmap.c
> @@ -129,7 +129,7 @@ static int gpio_regmap_get_direction(struct gpio_chip *chip,
>  		base = gpio_regmap_addr(gpio->reg_dir_in_base);
>  		invert = 1;
>  	} else {
> -		return -EOPNOTSUPP;
> +		return -ENOTSUPP;
>  	}
>  
>  	ret = gpio->reg_mask_xlate(gpio, base, offset, &reg, &mask);
> @@ -160,7 +160,7 @@ static int gpio_regmap_set_direction(struct gpio_chip *chip,
>  		base = gpio_regmap_addr(gpio->reg_dir_in_base);
>  		invert = 1;
>  	} else {
> -		return -EOPNOTSUPP;
> +		return -ENOTSUPP;
>  	}
>  
>  	ret = gpio->reg_mask_xlate(gpio, base, offset, &reg, &mask);


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 297 bytes --]

  reply	other threads:[~2024-04-11 10:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-10  6:39 [PATCH v1 1/1] gpio: regmap: Use -ENOTSUPP consistently Andy Shevchenko
2024-04-11 10:46 ` Michael Walle [this message]
2024-04-11 11:26   ` Andy Shevchenko
2024-04-12 10:30 ` Linus Walleij
2024-04-12 19:37 ` Bartosz Golaszewski

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=D0H8EQB97VFA.2P27K85EJXCTB@kernel.org \
    --to=mwalle@kernel.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=brgl@bgdev.pl \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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