summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpiolib.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2020-07-01 00:53:11 +0300
committerLinus Walleij <linus.walleij@linaro.org>2020-07-01 00:53:11 +0300
commitb239e4454e59bc85d466eb5630da46f6a876df77 (patch)
treecacf9c4b5c4242dd089c7714073dcbb5a7f3ffb3 /drivers/gpio/gpiolib.c
parent84651e81ee3323c7d544edfa6ac6026425fe5a52 (diff)
parentae66eca000cfef3ef0e31842102e17b1b660b1ce (diff)
downloadlinux-b239e4454e59bc85d466eb5630da46f6a876df77.tar.xz
Merge tag 'gpio-updates-for-v5.9-part1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into devel
gpio updates for v5.9 - use kobj_to_dev() in sysfs interface - kerneldoc and documentation fixes - relax the interrupt flags in gpio-mpc8xxx - support new model in gpio-pca953x - remove a redundant check from gpio-max732x - support a new platform in gpio-zynq (+ some minor fixes) - don't depend on GPIOLIB when already inside the "if GPIOLIB" in Kconfig - support PM ops for suspend in gpio-omap - minor tweaks in gpiolib
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r--drivers/gpio/gpiolib.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 4abd751314a5..291c088a5964 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -2594,10 +2594,9 @@ int gpiod_get_array_value_complex(bool raw, bool can_sleep,
bitmap_xor(value_bitmap, value_bitmap,
array_info->invert_mask, array_size);
- if (bitmap_full(array_info->get_mask, array_size))
- return 0;
-
i = find_first_zero_bit(array_info->get_mask, array_size);
+ if (i == array_size)
+ return 0;
} else {
array_info = NULL;
}
@@ -2878,10 +2877,9 @@ int gpiod_set_array_value_complex(bool raw, bool can_sleep,
gpio_chip_set_multiple(array_info->chip, array_info->set_mask,
value_bitmap);
- if (bitmap_full(array_info->set_mask, array_size))
- return 0;
-
i = find_first_zero_bit(array_info->set_mask, array_size);
+ if (i == array_size)
+ return 0;
} else {
array_info = NULL;
}