diff options
| author | Andy Shevchenko <[email protected]> | 2021-05-18 11:46:19 +0300 |
|---|---|---|
| committer | Bartosz Golaszewski <[email protected]> | 2021-05-21 14:53:35 +0200 |
| commit | fd80b8ba3aa5340a0bbfdc4b72bb6a2111cd54bf (patch) | |
| tree | 7f5de8425c1f7371814f024fa43601a02edcbea4 | |
| parent | 1189827a2cf72162e37c16d309c47d941cfd1936 (diff) | |
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 <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
| -rw-r--r-- | drivers/gpio/gpiolib-sysfs.c | 5 |
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 || |