summaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2021-05-18 11:46:19 +0300
committerBartosz Golaszewski <bgolaszewski@baylibre.com>2021-05-21 14:53:35 +0200
commitfd80b8ba3aa5340a0bbfdc4b72bb6a2111cd54bf (patch)
tree7f5de8425c1f7371814f024fa43601a02edcbea4 /drivers/gpio
parent1189827a2cf72162e37c16d309c47d941cfd1936 (diff)
downloadlinux-fd80b8ba3aa5340a0bbfdc4b72bb6a2111cd54bf.tar.gz
linux-fd80b8ba3aa5340a0bbfdc4b72bb6a2111cd54bf.tar.bz2
linux-fd80b8ba3aa5340a0bbfdc4b72bb6a2111cd54bf.zip
gpiolib: Make use of assign_bit() API (part 2)
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@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpiolib-sysfs.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c
index ae49bb23c6ed..ae7acd6a4f28 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 ||