[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMpxmJVGGhDfEAJNZoMsSw6Y05wRgDOtfqaYZyTzjsn_7uPfVg@mail.gmail.com>
Date: Fri, 21 May 2021 14:55:14 +0200
From: Bartosz Golaszewski <bgolaszewski@...libre.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: linux-gpio <linux-gpio@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Linus Walleij <linus.walleij@...aro.org>
Subject: Re: [PATCH v1 1/1] gpiolib: Make use of assign_bit() API (part 2)
On Tue, May 18, 2021 at 10:46 AM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> We have for some time the assign_bit() API to replace open coded
>
> if (foo)
> set_bit(n, bar);
> else
> clear_bit(n, bar);
>
> Use this API in GPIO library code.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
> drivers/gpio/gpiolib-sysfs.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c
> index 41b3b782bf3f..7c5afd999210 100644
> --- a/drivers/gpio/gpiolib-sysfs.c
> +++ b/drivers/gpio/gpiolib-sysfs.c
> @@ -312,10 +312,7 @@ static int gpio_sysfs_set_active_low(struct device *dev, int value)
> if (!!test_bit(FLAG_ACTIVE_LOW, &desc->flags) == !!value)
> return 0;
>
> - if (value)
> - set_bit(FLAG_ACTIVE_LOW, &desc->flags);
> - else
> - clear_bit(FLAG_ACTIVE_LOW, &desc->flags);
> + assign_bit(FLAG_ACTIVE_LOW, &desc->flags, value);
>
> /* reconfigure poll(2) support if enabled on one edge only */
> if (flags == GPIO_IRQF_TRIGGER_FALLING ||
> --
> 2.30.2
>
Patch applied, thanks!
Bartosz
Powered by blists - more mailing lists