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:
 <PH0PR03MB651210C6D5480D215619C1648EC92@PH0PR03MB6512.namprd03.prod.outlook.com>
Date: Mon, 3 Mar 2025 13:47:08 +0000
From: "Hennerich, Michael" <Michael.Hennerich@...log.com>
To: Bartosz Golaszewski <brgl@...ev.pl>,
        Linus Walleij
	<linus.walleij@...aro.org>,
        Laurent Pinchart
	<laurent.pinchart@...asonboard.com>,
        Mun Yew Tham <mun.yew.tham@...el.com>, Joel Stanley <joel@....id.au>,
        Andrew Jeffery <andrew@...econstruct.com.au>
CC: "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-pwm@...r.kernel.org" <linux-pwm@...r.kernel.org>,
        "patches@...nsource.cirrus.com" <patches@...nsource.cirrus.com>,
        "linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>,
        "linux-aspeed@...ts.ozlabs.org"
	<linux-aspeed@...ts.ozlabs.org>,
        Bartosz Golaszewski
	<bartosz.golaszewski@...aro.org>
Subject: RE: [PATCH 05/15] gpio: adp5520: use new line value setter callbacks



> -----Original Message-----
> From: Bartosz Golaszewski <brgl@...ev.pl>
> Sent: Monday, March 3, 2025 2:19 PM
> To: Linus Walleij <linus.walleij@...aro.org>; Bartosz Golaszewski
> <brgl@...ev.pl>; Hennerich, Michael <Michael.Hennerich@...log.com>;
> Laurent Pinchart <laurent.pinchart@...asonboard.com>; Mun Yew Tham
> <mun.yew.tham@...el.com>; Joel Stanley <joel@....id.au>; Andrew Jeffery
> <andrew@...econstruct.com.au>
> Cc: linux-gpio@...r.kernel.org; linux-kernel@...r.kernel.org; linux-
> pwm@...r.kernel.org; patches@...nsource.cirrus.com; linux-arm-
> kernel@...ts.infradead.org; linux-aspeed@...ts.ozlabs.org; Bartosz Golaszewski
> <bartosz.golaszewski@...aro.org>
> Subject: [PATCH 05/15] gpio: adp5520: use new line value setter callbacks
> 
> 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>

Acked-by: Michael Hennerich <michael.hennerich@...log.com>

> ---
>  drivers/gpio/gpio-adp5520.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-adp5520.c b/drivers/gpio/gpio-adp5520.c index
> c55e821c63b6..57d12c10cbda 100644
> --- a/drivers/gpio/gpio-adp5520.c
> +++ b/drivers/gpio/gpio-adp5520.c
> @@ -40,16 +40,18 @@ static int adp5520_gpio_get_value(struct gpio_chip
> *chip, unsigned off)
>  	return !!(reg_val & dev->lut[off]);
>  }
> 
> -static void adp5520_gpio_set_value(struct gpio_chip *chip,
> -		unsigned off, int val)
> +static int adp5520_gpio_set_value(struct gpio_chip *chip,
> +				  unsigned int off, int val)
>  {
>  	struct adp5520_gpio *dev;
>  	dev = gpiochip_get_data(chip);
> 
>  	if (val)
> -		adp5520_set_bits(dev->master, ADP5520_GPIO_OUT, dev-
> >lut[off]);
> +		return adp5520_set_bits(dev->master, ADP5520_GPIO_OUT,
> +					dev->lut[off]);
>  	else
> -		adp5520_clr_bits(dev->master, ADP5520_GPIO_OUT, dev-
> >lut[off]);
> +		return adp5520_clr_bits(dev->master, ADP5520_GPIO_OUT,
> +					dev->lut[off]);
>  }
> 
>  static int adp5520_gpio_direction_input(struct gpio_chip *chip, unsigned off)
> @@ -120,7 +122,7 @@ static int adp5520_gpio_probe(struct platform_device
> *pdev)
>  	gc->direction_input  = adp5520_gpio_direction_input;
>  	gc->direction_output = adp5520_gpio_direction_output;
>  	gc->get = adp5520_gpio_get_value;
> -	gc->set = adp5520_gpio_set_value;
> +	gc->set_rv = adp5520_gpio_set_value;
>  	gc->can_sleep = true;
> 
>  	gc->base = pdata->gpio_start;
> 
> --
> 2.45.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ