linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matti Vaittinen <mazziesaccount@gmail.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>, Ray Jui <rjui@broadcom.com>,
	Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	Marek Vasut <marek.vasut+renesas@gmail.com>,
	Michael Buesch <m@bues.ch>,
	Thomas Richard <thomas.richard@bootlin.com>,
	Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>,
	Benson Leung <bleung@chromium.org>,
	Guenter Roeck <groeck@chromium.org>,
	Andy Shevchenko <andy@kernel.org>,
	Support Opensource <support.opensource@diasemi.com>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org,
	chrome-platform@lists.linux.dev,
	Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: Re: [PATCH 03/15] gpio: bd71815: use new line value setter callbacks
Date: Mon, 10 Mar 2025 15:16:19 +0200	[thread overview]
Message-ID: <a9f27271-320b-4cd3-a3bb-bd5aa3ac30da@gmail.com> (raw)
In-Reply-To: <20250310-gpiochip-set-conversion-v1-3-03798bb833eb@linaro.org>

On 10/03/2025 14:40, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> 
> struct gpio_chip now has callbacks for setting line values that return
> an integer, allowing to indicate failures. Convert the driver to using
> them.
> 
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>

Thanks!

> ---
>   drivers/gpio/gpio-bd71815.c | 15 ++++++---------
>   1 file changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-bd71815.c b/drivers/gpio/gpio-bd71815.c
> index 08ff2857256f..36701500925e 100644
> --- a/drivers/gpio/gpio-bd71815.c
> +++ b/drivers/gpio/gpio-bd71815.c
> @@ -37,21 +37,18 @@ static int bd71815gpo_get(struct gpio_chip *chip, unsigned int offset)
>   	return (val >> offset) & 1;
>   }
>   
> -static void bd71815gpo_set(struct gpio_chip *chip, unsigned int offset,
> -			   int value)
> +static int bd71815gpo_set(struct gpio_chip *chip, unsigned int offset,
> +			  int value)
>   {
>   	struct bd71815_gpio *bd71815 = gpiochip_get_data(chip);
> -	int ret, bit;
> +	int bit;
>   
>   	bit = BIT(offset);
>   
>   	if (value)
> -		ret = regmap_set_bits(bd71815->regmap, BD71815_REG_GPO, bit);
> -	else
> -		ret = regmap_clear_bits(bd71815->regmap, BD71815_REG_GPO, bit);
> +		return regmap_set_bits(bd71815->regmap, BD71815_REG_GPO, bit);
>   
> -	if (ret)
> -		dev_warn(bd71815->dev, "failed to toggle GPO\n");
> +	return regmap_clear_bits(bd71815->regmap, BD71815_REG_GPO, bit);
>   }
>   
>   static int bd71815_gpio_set_config(struct gpio_chip *chip, unsigned int offset,
> @@ -88,7 +85,7 @@ static const struct gpio_chip bd71815gpo_chip = {
>   	.owner			= THIS_MODULE,
>   	.get			= bd71815gpo_get,
>   	.get_direction		= bd71815gpo_direction_get,
> -	.set			= bd71815gpo_set,
> +	.set_rv			= bd71815gpo_set,
>   	.set_config		= bd71815_gpio_set_config,
>   	.can_sleep		= true,
>   };
> 


  reply	other threads:[~2025-03-10 13:16 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-10 12:40 [PATCH 00/15] gpio: more gpio_chip setter conversions Bartosz Golaszewski
2025-03-10 12:40 ` [PATCH 01/15] gpio: bcm-kona: use lock guards Bartosz Golaszewski
2025-03-10 12:40 ` [PATCH 02/15] gpio: bcm-kona: use new line value setter callbacks Bartosz Golaszewski
2025-03-10 12:40 ` [PATCH 03/15] gpio: bd71815: " Bartosz Golaszewski
2025-03-10 13:16   ` Matti Vaittinen [this message]
2025-03-10 12:40 ` [PATCH 04/15] gpio: bd71828: " Bartosz Golaszewski
2025-03-10 13:20   ` Matti Vaittinen
2025-03-10 13:22     ` Bartosz Golaszewski
2025-03-10 14:44       ` Matti Vaittinen
2025-03-10 12:40 ` [PATCH 05/15] gpio: bd9571mwv: " Bartosz Golaszewski
2025-03-10 13:21   ` Matti Vaittinen
2025-03-10 12:40 ` [PATCH 06/15] gpio: bt8xx: allow to build the module with COMPILE_TEST=y Bartosz Golaszewski
2025-03-10 12:40 ` [PATCH 07/15] gpio: bt8xx: use lock guards Bartosz Golaszewski
2025-03-10 12:40 ` [PATCH 08/15] gpio: bt8xx: use new line value setter callbacks Bartosz Golaszewski
2025-03-10 12:40 ` [PATCH 09/15] gpio: cgbc: " Bartosz Golaszewski
2025-03-10 12:40 ` [PATCH 10/15] gpio: creg-snps: " Bartosz Golaszewski
2025-03-10 12:40 ` [PATCH 11/15] gpio: cros-ec: " Bartosz Golaszewski
2025-03-12  3:13   ` Tzung-Bi Shih
2025-03-10 12:40 ` [PATCH 12/15] gpio: crystalcove: " Bartosz Golaszewski
2025-03-10 12:40 ` [PATCH 13/15] gpio: cs5535: " Bartosz Golaszewski
2025-03-10 12:40 ` [PATCH 14/15] gpio: da9052: " Bartosz Golaszewski
2025-03-10 12:40 ` [PATCH 15/15] gpio: da9055: " Bartosz Golaszewski
2025-03-17  7:28 ` [PATCH 00/15] gpio: more gpio_chip setter conversions 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=a9f27271-320b-4cd3-a3bb-bd5aa3ac30da@gmail.com \
    --to=mazziesaccount@gmail.com \
    --cc=Eugeniy.Paltsev@synopsys.com \
    --cc=andy@kernel.org \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bleung@chromium.org \
    --cc=brgl@bgdev.pl \
    --cc=chrome-platform@lists.linux.dev \
    --cc=florian.fainelli@broadcom.com \
    --cc=groeck@chromium.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=m@bues.ch \
    --cc=marek.vasut+renesas@gmail.com \
    --cc=rjui@broadcom.com \
    --cc=sbranden@broadcom.com \
    --cc=support.opensource@diasemi.com \
    --cc=thomas.richard@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).