[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YlcAEPYOBHk+NAD8@smile.fi.intel.com>
Date: Wed, 13 Apr 2022 19:53:36 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: Kent Gibson <warthog618@...il.com>,
Linus Walleij <linus.walleij@...aro.org>,
linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH] gpio: sim: fix setting and getting multiple lines
On Wed, Apr 13, 2022 at 04:01:32PM +0200, Bartosz Golaszewski wrote:
> We need to take mask into account in the set/get_multiple() callbacks.
> Use bitmap_replace() instead of bitmap_copy().
Good catch!
Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Fixes: cb8c474e79be ("gpio: sim: new testing module")
> Cc: stable@...r.kernel.org
> Signed-off-by: Bartosz Golaszewski <brgl@...ev.pl>
> ---
> drivers/gpio/gpio-sim.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c
> index 8e5d87984a48..41c31b10ae84 100644
> --- a/drivers/gpio/gpio-sim.c
> +++ b/drivers/gpio/gpio-sim.c
> @@ -134,7 +134,7 @@ static int gpio_sim_get_multiple(struct gpio_chip *gc,
> struct gpio_sim_chip *chip = gpiochip_get_data(gc);
>
> mutex_lock(&chip->lock);
> - bitmap_copy(bits, chip->value_map, gc->ngpio);
> + bitmap_replace(bits, bits, chip->value_map, mask, gc->ngpio);
> mutex_unlock(&chip->lock);
>
> return 0;
> @@ -146,7 +146,7 @@ static void gpio_sim_set_multiple(struct gpio_chip *gc,
> struct gpio_sim_chip *chip = gpiochip_get_data(gc);
>
> mutex_lock(&chip->lock);
> - bitmap_copy(chip->value_map, bits, gc->ngpio);
> + bitmap_replace(chip->value_map, chip->value_map, bits, mask, gc->ngpio);
> mutex_unlock(&chip->lock);
> }
>
> --
> 2.32.0
>
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists