Linux GPIO subsystem development
 help / color / mirror / Atom feed
* [PATCH 1/3] iio: addac: ad74413r: use ngpio size when iterating over mask
@ 2022-01-06  6:22 Cosmin Tanislav
  2022-01-06  6:22 ` [PATCH 2/3] iio: addac: ad74413r: for_each_set_bit_from -> for_each_set_bit Cosmin Tanislav
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Cosmin Tanislav @ 2022-01-06  6:22 UTC (permalink / raw)
  Cc: cosmin.tanislav, demonsingur, Lars-Peter Clausen,
	Michael Hennerich, Rob Herring, linux-iio, devicetree,
	linux-kernel, Linus Walleij, Bartosz Golaszewski, linux-gpio

ngpio is the actual number of GPIOs handled by the GPIO chip,
as opposed to the max number of GPIOs.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
---
 drivers/iio/addac/ad74413r.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/addac/ad74413r.c b/drivers/iio/addac/ad74413r.c
index 5271073bb74e..6ea3cd933d05 100644
--- a/drivers/iio/addac/ad74413r.c
+++ b/drivers/iio/addac/ad74413r.c
@@ -288,7 +288,7 @@ static void ad74413r_gpio_set_multiple(struct gpio_chip *chip,
 	unsigned int offset = 0;
 	int ret;
 
-	for_each_set_bit_from(offset, mask, AD74413R_CHANNEL_MAX) {
+	for_each_set_bit_from(offset, mask, chip->ngpio) {
 		unsigned int real_offset = st->gpo_gpio_offsets[offset];
 
 		ret = ad74413r_set_gpo_config(st, real_offset,
@@ -334,7 +334,7 @@ static int ad74413r_gpio_get_multiple(struct gpio_chip *chip,
 	if (ret)
 		return ret;
 
-	for_each_set_bit_from(offset, mask, AD74413R_CHANNEL_MAX) {
+	for_each_set_bit_from(offset, mask, chip->ngpio) {
 		unsigned int real_offset = st->comp_gpio_offsets[offset];
 
 		if (val & BIT(real_offset))
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-01-10 18:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-06  6:22 [PATCH 1/3] iio: addac: ad74413r: use ngpio size when iterating over mask Cosmin Tanislav
2022-01-06  6:22 ` [PATCH 2/3] iio: addac: ad74413r: for_each_set_bit_from -> for_each_set_bit Cosmin Tanislav
2022-01-06  6:22 ` [PATCH 3/3] iio: addac: ad74413r: correct comparator gpio getters mask usage Cosmin Tanislav
2022-01-09 12:13   ` Andy Shevchenko
2022-01-09 12:14     ` Andy Shevchenko
2022-01-10 16:55     ` Cosmin Tanislav
2022-01-10 18:22       ` Andy Shevchenko
2022-01-09 12:07 ` [PATCH 1/3] iio: addac: ad74413r: use ngpio size when iterating over mask Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox