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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4cd7b1ea029f7cdb6312f61b1008116b58b85efe.camel@gmail.com>
Date: Tue, 15 Apr 2025 10:06:51 +0100
From: Nuno Sá <noname.nuno@...il.com>
To: Bartosz Golaszewski <brgl@...ev.pl>, Michael Hennerich	
 <michael.hennerich@...log.com>, Dmitry Torokhov
 <dmitry.torokhov@...il.com>,  Linus Walleij <linus.walleij@...aro.org>
Cc: linux-input@...r.kernel.org, linux-kernel@...r.kernel.org, 
	linux-gpio@...r.kernel.org, Bartosz Golaszewski
 <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH 3/3] Input: adp5589 - use new GPIO line value setter
 callbacks

On Mon, 2025-04-07 at 09:19 +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>
> ---

Let's maybe drop this one? I'll send a new version of this [1] that will drop
this driver...

BTW, I can already change my v2 and use .set_rv()...

[1]: https://lore.kernel.org/linux-input/20250313-dev-adp5589-fw-v1-13-20e80d4bd4ea@analog.com/

- Nuno Sá

>  drivers/input/keyboard/adp5589-keys.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/input/keyboard/adp5589-keys.c
> b/drivers/input/keyboard/adp5589-keys.c
> index 81d0876ee358..986a789f1ec3 100644
> --- a/drivers/input/keyboard/adp5589-keys.c
> +++ b/drivers/input/keyboard/adp5589-keys.c
> @@ -404,8 +404,8 @@ static int adp5589_gpio_get_value(struct gpio_chip *chip,
> unsigned off)
>  	return !!(val & bit);
>  }
>  
> -static void adp5589_gpio_set_value(struct gpio_chip *chip,
> -				   unsigned off, int val)
> +static int adp5589_gpio_set_value(struct gpio_chip *chip, unsigned int off,
> +				  int val)
>  {
>  	struct adp5589_kpad *kpad = gpiochip_get_data(chip);
>  	unsigned int bank = kpad->var->bank(kpad->gpiomap[off]);
> @@ -418,8 +418,9 @@ static void adp5589_gpio_set_value(struct gpio_chip *chip,
>  	else
>  		kpad->dat_out[bank] &= ~bit;
>  
> -	adp5589_write(kpad->client, kpad->var->reg(ADP5589_GPO_DATA_OUT_A) +
> -		      bank, kpad->dat_out[bank]);
> +	return adp5589_write(kpad->client,
> +			     kpad->var->reg(ADP5589_GPO_DATA_OUT_A) + bank,
> +			     kpad->dat_out[bank]);
>  }
>  
>  static int adp5589_gpio_direction_input(struct gpio_chip *chip, unsigned off)
> @@ -520,7 +521,7 @@ static int adp5589_gpio_add(struct adp5589_kpad *kpad)
>  	kpad->gc.direction_input = adp5589_gpio_direction_input;
>  	kpad->gc.direction_output = adp5589_gpio_direction_output;
>  	kpad->gc.get = adp5589_gpio_get_value;
> -	kpad->gc.set = adp5589_gpio_set_value;
> +	kpad->gc.set_rv = adp5589_gpio_set_value;
>  	kpad->gc.can_sleep = 1;
>  
>  	kpad->gc.base = gpio_data->gpio_start;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ