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: <fe3323d0-161c-498d-92e8-7a723f8d9780@foss.st.com>
Date: Thu, 24 Apr 2025 16:59:47 +0200
From: Amelie Delaunay <amelie.delaunay@...s.st.com>
To: Bartosz Golaszewski <brgl@...ev.pl>,
        Basavaraj Natikar
	<Basavaraj.Natikar@....com>,
        Shyam Sundar S K <Shyam-sundar.S-k@....com>,
        Linus Walleij <linus.walleij@...aro.org>, Chen-Yu Tsai <wens@...e.org>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        Alexandre Torgue
	<alexandre.torgue@...s.st.com>,
        Andreas Färber
	<afaerber@...e.de>,
        Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
        Paul Cercueil <paul@...pouillou.net>,
        Steen Hegelund
	<Steen.Hegelund@...rochip.com>,
        Daniel Machon <daniel.machon@...rochip.com>,
        <UNGLinuxDriver@...rochip.com>,
        Ludovic Desroches
	<ludovic.desroches@...rochip.com>,
        Nicolas Ferre
	<nicolas.ferre@...rochip.com>,
        Alexandre Belloni
	<alexandre.belloni@...tlin.com>,
        Claudiu Beznea <claudiu.beznea@...on.dev>,
        Andrew Lunn <andrew@...n.ch>,
        Gregory Clement <gregory.clement@...tlin.com>,
        Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
        Krzysztof Kozlowski
	<krzk@...nel.org>,
        Sylwester Nawrocki <s.nawrocki@...sung.com>,
        Alim Akhtar
	<alim.akhtar@...sung.com>
CC: <linux-samsung-soc@...r.kernel.org>,
        Bartosz Golaszewski
	<bartosz.golaszewski@...aro.org>,
        <linux-actions@...ts.infradead.org>, <linux-mips@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <linux-gpio@...r.kernel.org>,
        <linux-stm32@...md-mailman.stormreply.com>,
        <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [Linux-stm32] [PATCH 03/12] pinctrl: stmfx: use new GPIO line
 value setter callbacks



On 4/24/25 10:35, 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>

Reviewed-by: Amelie Delaunay <amelie.delaunay@...s.st.com>

> ---
>   drivers/pinctrl/pinctrl-stmfx.c | 13 ++++++++-----
>   1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c
> index aae01120dc52..f4fdcaa043e6 100644
> --- a/drivers/pinctrl/pinctrl-stmfx.c
> +++ b/drivers/pinctrl/pinctrl-stmfx.c
> @@ -115,14 +115,14 @@ static int stmfx_gpio_get(struct gpio_chip *gc, unsigned int offset)
>   	return ret ? ret : !!(value & mask);
>   }
>   
> -static void stmfx_gpio_set(struct gpio_chip *gc, unsigned int offset, int value)
> +static int stmfx_gpio_set(struct gpio_chip *gc, unsigned int offset, int value)
>   {
>   	struct stmfx_pinctrl *pctl = gpiochip_get_data(gc);
>   	u32 reg = value ? STMFX_REG_GPO_SET : STMFX_REG_GPO_CLR;
>   	u32 mask = get_mask(offset);
>   
> -	regmap_write_bits(pctl->stmfx->map, reg + get_reg(offset),
> -			  mask, mask);
> +	return regmap_write_bits(pctl->stmfx->map, reg + get_reg(offset),
> +				 mask, mask);
>   }
>   
>   static int stmfx_gpio_get_direction(struct gpio_chip *gc, unsigned int offset)
> @@ -161,8 +161,11 @@ static int stmfx_gpio_direction_output(struct gpio_chip *gc,
>   	struct stmfx_pinctrl *pctl = gpiochip_get_data(gc);
>   	u32 reg = STMFX_REG_GPIO_DIR + get_reg(offset);
>   	u32 mask = get_mask(offset);
> +	int ret;
>   
> -	stmfx_gpio_set(gc, offset, value);
> +	ret = stmfx_gpio_set(gc, offset, value);
> +	if (ret)
> +		return ret;
>   
>   	return regmap_write_bits(pctl->stmfx->map, reg, mask, mask);
>   }
> @@ -694,7 +697,7 @@ static int stmfx_pinctrl_probe(struct platform_device *pdev)
>   	pctl->gpio_chip.direction_input = stmfx_gpio_direction_input;
>   	pctl->gpio_chip.direction_output = stmfx_gpio_direction_output;
>   	pctl->gpio_chip.get = stmfx_gpio_get;
> -	pctl->gpio_chip.set = stmfx_gpio_set;
> +	pctl->gpio_chip.set_rv = stmfx_gpio_set;
>   	pctl->gpio_chip.set_config = gpiochip_generic_config;
>   	pctl->gpio_chip.base = -1;
>   	pctl->gpio_chip.ngpio = pctl->pctl_desc.npins;
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ