lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ba7e31ff-5744-4409-921f-e2014f23151b@linaro.org>
Date: Tue, 8 Apr 2025 16:27:39 +0200
From: Neil Armstrong <neil.armstrong@...aro.org>
To: Bartosz Golaszewski <brgl@...ev.pl>,
 Ludovic Desroches <ludovic.desroches@...rochip.com>,
 Linus Walleij <linus.walleij@...aro.org>,
 Nicolas Ferre <nicolas.ferre@...rochip.com>,
 Alexandre Belloni <alexandre.belloni@...tlin.com>,
 Claudiu Beznea <claudiu.beznea@...on.dev>,
 Kevin Hilman <khilman@...libre.com>, Jerome Brunet <jbrunet@...libre.com>,
 Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
 Xianwei Zhao <xianwei.zhao@...ogic.com>,
 Patrick Rudolph <patrick.rudolph@...ements.com>
Cc: linux-arm-kernel@...ts.infradead.org, linux-gpio@...r.kernel.org,
 linux-kernel@...r.kernel.org, linux-amlogic@...ts.infradead.org,
 Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH 08/10] pinctrl: sx150x: use new GPIO line value setter
 callbacks

On 08/04/2025 09:17, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@...aro.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@...aro.org>
> ---
>   drivers/pinctrl/pinctrl-sx150x.c | 23 ++++++++++++-----------
>   1 file changed, 12 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-sx150x.c b/drivers/pinctrl/pinctrl-sx150x.c
> index 98262b8ce43a..d3a12c1c0de2 100644
> --- a/drivers/pinctrl/pinctrl-sx150x.c
> +++ b/drivers/pinctrl/pinctrl-sx150x.c
> @@ -432,24 +432,25 @@ static int sx150x_gpio_oscio_set(struct sx150x_pinctrl *pctl,
>   			    (value ? 0x1f : 0x10));
>   }
>   
> -static void sx150x_gpio_set(struct gpio_chip *chip, unsigned int offset,
> -			    int value)
> +static int sx150x_gpio_set(struct gpio_chip *chip, unsigned int offset,
> +			   int value)
>   {
>   	struct sx150x_pinctrl *pctl = gpiochip_get_data(chip);
>   
>   	if (sx150x_pin_is_oscio(pctl, offset))
> -		sx150x_gpio_oscio_set(pctl, value);
> -	else
> -		__sx150x_gpio_set(pctl, offset, value);
> +		return sx150x_gpio_oscio_set(pctl, value);
> +
> +	return __sx150x_gpio_set(pctl, offset, value);
>   }
>   
> -static void sx150x_gpio_set_multiple(struct gpio_chip *chip,
> -				     unsigned long *mask,
> -				     unsigned long *bits)
> +static int sx150x_gpio_set_multiple(struct gpio_chip *chip,
> +				    unsigned long *mask,
> +				    unsigned long *bits)
>   {
>   	struct sx150x_pinctrl *pctl = gpiochip_get_data(chip);
>   
> -	regmap_write_bits(pctl->regmap, pctl->data->reg_data, *mask, *bits);
> +	return regmap_write_bits(pctl->regmap, pctl->data->reg_data, *mask,
> +				 *bits);
>   }
>   
>   static int sx150x_gpio_direction_input(struct gpio_chip *chip,
> @@ -1175,7 +1176,7 @@ static int sx150x_probe(struct i2c_client *client)
>   	pctl->gpio.direction_input = sx150x_gpio_direction_input;
>   	pctl->gpio.direction_output = sx150x_gpio_direction_output;
>   	pctl->gpio.get = sx150x_gpio_get;
> -	pctl->gpio.set = sx150x_gpio_set;
> +	pctl->gpio.set_rv = sx150x_gpio_set;
>   	pctl->gpio.set_config = gpiochip_generic_config;
>   	pctl->gpio.parent = dev;
>   	pctl->gpio.can_sleep = true;
> @@ -1190,7 +1191,7 @@ static int sx150x_probe(struct i2c_client *client)
>   	 * would require locking that is not in place at this time.
>   	 */
>   	if (pctl->data->model != SX150X_789)
> -		pctl->gpio.set_multiple = sx150x_gpio_set_multiple;
> +		pctl->gpio.set_multiple_rv = sx150x_gpio_set_multiple;
>   
>   	/* Add Interrupt support if an irq is specified */
>   	if (client->irq > 0) {
> 

Reviewed-by: Neil Armstrong <neil.armstrong@...aro.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ