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] [day] [month] [year] [list]
Message-ID: <20250613072024.GE3141695@robin.jannau.net>
Date: Fri, 13 Jun 2025 09:20:24 +0200
From: Janne Grunau <j@...nau.net>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: Dvorkin Dmitry <dvorkin@...bo.com>, Wells Lu <wellslutw@...il.com>,
	Linus Walleij <linus.walleij@...aro.org>,
	Patrice Chotard <patrice.chotard@...s.st.com>,
	Support Opensource <support.opensource@...semi.com>,
	Baruch Siach <baruch@...s.co.il>, Sven Peter <sven@...nel.org>,
	Alyssa Rosenzweig <alyssa@...enzweig.io>,
	Neal Gompa <neal@...pa.dev>, Viresh Kumar <vireshk@...nel.org>,
	Lakshmi Sowjanya D <lakshmi.sowjanya.d@...el.com>,
	Chen-Yu Tsai <wens@...e.org>,
	Jernej Skrabec <jernej.skrabec@...il.com>,
	Samuel Holland <samuel@...lland.org>,
	linux-arm-kernel@...ts.infradead.org, linux-gpio@...r.kernel.org,
	linux-kernel@...r.kernel.org, asahi@...ts.linux.dev,
	soc@...ts.linux.dev, linux-sunxi@...ts.linux.dev,
	Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH 10/16] pinctrl: apple: use new GPIO line value setter
 callbacks

On Thu, Jun 12, 2025 at 03:15:19PM +0200, 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-apple-gpio.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-apple-gpio.c b/drivers/pinctrl/pinctrl-apple-gpio.c
> index 0f551d67d482d96c7a1e4c28a6db580f0db6452e..dcf3a921b4df54250194403f06a3c1fb40110eaa 100644
> --- a/drivers/pinctrl/pinctrl-apple-gpio.c
> +++ b/drivers/pinctrl/pinctrl-apple-gpio.c
> @@ -217,11 +217,13 @@ static int apple_gpio_get(struct gpio_chip *chip, unsigned offset)
>  	return !!(reg & REG_GPIOx_DATA);
>  }
>  
> -static void apple_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
> +static int apple_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
>  {
>  	struct apple_gpio_pinctrl *pctl = gpiochip_get_data(chip);
>  
>  	apple_gpio_set_reg(pctl, offset, REG_GPIOx_DATA, value ? REG_GPIOx_DATA : 0);
> +
> +	return 0;
>  }
>  
>  static int apple_gpio_direction_input(struct gpio_chip *chip, unsigned int offset)
> @@ -376,7 +378,7 @@ static int apple_gpio_register(struct apple_gpio_pinctrl *pctl)
>  	pctl->gpio_chip.direction_input = apple_gpio_direction_input;
>  	pctl->gpio_chip.direction_output = apple_gpio_direction_output;
>  	pctl->gpio_chip.get = apple_gpio_get;
> -	pctl->gpio_chip.set = apple_gpio_set;
> +	pctl->gpio_chip.set_rv = apple_gpio_set;
>  	pctl->gpio_chip.base = -1;
>  	pctl->gpio_chip.ngpio = pctl->pinctrl_desc.npins;
>  	pctl->gpio_chip.parent = pctl->dev;

apple_gpio_set_reg() could pass the return value of regmap_update_bits()
but I suppose this change to switch to the new callback is ok on its
own.

Reviewed-by: Janne Grunau <j@...nau.net>

Janne 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ