linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep
@ 2025-01-31 20:24 David Lechner
  2025-01-31 20:24 ` [PATCH 01/13] gpiolib: add gpiods_set_array_value_cansleep() David Lechner
                   ` (15 more replies)
  0 siblings, 16 replies; 37+ messages in thread
From: David Lechner @ 2025-01-31 20:24 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound, David Lechner

This series was inspired by some minor annoyance I have experienced a
few times in recent reviews.

Calling gpiod_set_array_value_cansleep() can be quite verbose due to
having so many parameters. In most cases, we already have a struct
gpio_descs that contains the first 3 parameters so we end up with 3 (or
often even 6) pointer indirections at each call site. Also, people have
a tendency to want to hard-code the first argument instead of using
struct gpio_descs.ndescs, often without checking that ndescs >= the
hard-coded value.

So I'm proposing that we add a gpiods_set_array_value_cansleep()
function that is a wrapper around gpiod_set_array_value_cansleep()
that has struct gpio_descs as the first parameter to make it a bit
easier to read the code and avoid the hard-coding temptation.

I've just done gpiods_set_array_value_cansleep() for now since there
were over 10 callers of this one. There aren't as many callers of
the get and atomic variants, but we can add those too if this seems
like a useful thing to do.

---
David Lechner (13):
      gpiolib: add gpiods_set_array_value_cansleep()
      auxdisplay: seg-led-gpio: use gpiods_set_array_value_cansleep
      bus: ts-nbus: validate ts,data-gpios array size
      bus: ts-nbus: use gpiods_set_array_value_cansleep
      gpio: max3191x: use gpiods_set_array_value_cansleep
      iio: adc: ad7606: use gpiods_set_array_value_cansleep
      iio: amplifiers: hmc425a: use gpiods_set_array_value_cansleep
      iio: resolver: ad2s1210: use gpiods_set_array_value_cansleep
      mmc: pwrseq_simple: use gpiods_set_array_value_cansleep
      mux: gpio: use gpiods_set_array_value_cansleep
      net: mdio: mux-gpio: use gpiods_set_array_value_cansleep
      phy: mapphone-mdm6600: use gpiods_set_array_value_cansleep
      ASoC: adau1701: use gpiods_set_array_value_cansleep

 drivers/auxdisplay/seg-led-gpio.c           |  3 +--
 drivers/bus/ts-nbus.c                       | 10 ++++++----
 drivers/gpio/gpio-max3191x.c                | 18 +++++++-----------
 drivers/iio/adc/ad7606.c                    |  3 +--
 drivers/iio/adc/ad7606_spi.c                |  3 +--
 drivers/iio/amplifiers/hmc425a.c            |  3 +--
 drivers/iio/resolver/ad2s1210.c             |  8 ++------
 drivers/mmc/core/pwrseq_simple.c            |  3 +--
 drivers/mux/gpio.c                          |  4 +---
 drivers/net/mdio/mdio-mux-gpio.c            |  3 +--
 drivers/phy/motorola/phy-mapphone-mdm6600.c |  4 +---
 include/linux/gpio/consumer.h               |  7 +++++++
 sound/soc/codecs/adau1701.c                 |  4 +---
 13 files changed, 31 insertions(+), 42 deletions(-)
---
base-commit: df4b2bbff898227db0c14264ac7edd634e79f755
change-id: 20250131-gpio-set-array-helper-bd4a328370d3

Best regards,
-- 
David Lechner <dlechner@baylibre.com>


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

* [PATCH 01/13] gpiolib: add gpiods_set_array_value_cansleep()
  2025-01-31 20:24 [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep David Lechner
@ 2025-01-31 20:24 ` David Lechner
  2025-02-02 10:06   ` Andy Shevchenko
  2025-01-31 20:24 ` [PATCH 02/13] auxdisplay: seg-led-gpio: use gpiods_set_array_value_cansleep David Lechner
                   ` (14 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: David Lechner @ 2025-01-31 20:24 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound, David Lechner

Add a new gpiods_set_array_value_cansleep() helper function with fewer
parameters than gpiod_set_array_value_cansleep().

Calling gpiod_set_array_value_cansleep() can get quite verbose. In many
cases, the first arguments all come from the same struct gpio_descs, so
having a separate function where we can just pass that cuts down on the
boilerplate.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 include/linux/gpio/consumer.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index db2dfbae8edbd12059826183b1c0f73c7a58ff40..1c9bb3cb1ee80fe52aabf5bd24b1d128eff2bc99 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -655,4 +655,11 @@ static inline void gpiod_unexport(struct gpio_desc *desc)
 
 #endif /* CONFIG_GPIOLIB && CONFIG_GPIO_SYSFS */
 
+static inline int gpiods_set_array_value_cansleep(struct gpio_descs *descs,
+						  unsigned long *value_bitmap)
+{
+	return gpiod_set_array_value_cansleep(descs->ndescs, descs->desc,
+					      descs->info, value_bitmap);
+}
+
 #endif

-- 
2.43.0


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

* [PATCH 02/13] auxdisplay: seg-led-gpio: use gpiods_set_array_value_cansleep
  2025-01-31 20:24 [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep David Lechner
  2025-01-31 20:24 ` [PATCH 01/13] gpiolib: add gpiods_set_array_value_cansleep() David Lechner
@ 2025-01-31 20:24 ` David Lechner
  2025-02-02 10:08   ` Andy Shevchenko
  2025-02-03 10:34   ` Geert Uytterhoeven
  2025-01-31 20:24 ` [PATCH 03/13] bus: ts-nbus: validate ts,data-gpios array size David Lechner
                   ` (13 subsequent siblings)
  15 siblings, 2 replies; 37+ messages in thread
From: David Lechner @ 2025-01-31 20:24 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound, David Lechner

Reduce verbosity by using gpiods_set_array_value_cansleep() instead of
gpiods_set_array_value_cansleep().

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/auxdisplay/seg-led-gpio.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/auxdisplay/seg-led-gpio.c b/drivers/auxdisplay/seg-led-gpio.c
index f10c25e6bf126cfaac3e4c353f8bfc6639d94a60..c158b2c2827415e75d0b122914b8b18c043e8c76 100644
--- a/drivers/auxdisplay/seg-led-gpio.c
+++ b/drivers/auxdisplay/seg-led-gpio.c
@@ -36,8 +36,7 @@ static void seg_led_update(struct work_struct *work)
 
 	bitmap_set_value8(values, map_to_seg7(&map->map.seg7, linedisp->buf[0]), 0);
 
-	gpiod_set_array_value_cansleep(priv->segment_gpios->ndescs, priv->segment_gpios->desc,
-				       priv->segment_gpios->info, values);
+	gpiods_set_array_value_cansleep(priv->segment_gpios, values);
 }
 
 static int seg_led_linedisp_get_map_type(struct linedisp *linedisp)

-- 
2.43.0


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

* [PATCH 03/13] bus: ts-nbus: validate ts,data-gpios array size
  2025-01-31 20:24 [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep David Lechner
  2025-01-31 20:24 ` [PATCH 01/13] gpiolib: add gpiods_set_array_value_cansleep() David Lechner
  2025-01-31 20:24 ` [PATCH 02/13] auxdisplay: seg-led-gpio: use gpiods_set_array_value_cansleep David Lechner
@ 2025-01-31 20:24 ` David Lechner
  2025-01-31 20:24 ` [PATCH 04/13] bus: ts-nbus: use gpiods_set_array_value_cansleep David Lechner
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 37+ messages in thread
From: David Lechner @ 2025-01-31 20:24 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound, David Lechner

Add validation of ts,data-gpios array size during probe. The driver
later hard-codes 8 as the size of the array when using it, so we should
be validating that the array is actually that big to prevent possible
out of bounds accesses.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/bus/ts-nbus.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/bus/ts-nbus.c b/drivers/bus/ts-nbus.c
index 2328c48b9b1260e805c631f2aa7379d620084537..d3ee102a13893c83c50e41f7298821f4d7ae3487 100644
--- a/drivers/bus/ts-nbus.c
+++ b/drivers/bus/ts-nbus.c
@@ -48,6 +48,10 @@ static int ts_nbus_init_pdata(struct platform_device *pdev,
 		return dev_err_probe(&pdev->dev, PTR_ERR(ts_nbus->data),
 				     "failed to retrieve ts,data-gpio from dts\n");
 
+	if (ts_nbus->data->ndescs != 8)
+		return dev_err_probe(&pdev->dev, -EINVAL,
+				     "invalid number of ts,data-gpios\n");
+
 	ts_nbus->csn = devm_gpiod_get(&pdev->dev, "ts,csn", GPIOD_OUT_HIGH);
 	if (IS_ERR(ts_nbus->csn))
 		return dev_err_probe(&pdev->dev, PTR_ERR(ts_nbus->csn),

-- 
2.43.0


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

* [PATCH 04/13] bus: ts-nbus: use gpiods_set_array_value_cansleep
  2025-01-31 20:24 [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep David Lechner
                   ` (2 preceding siblings ...)
  2025-01-31 20:24 ` [PATCH 03/13] bus: ts-nbus: validate ts,data-gpios array size David Lechner
@ 2025-01-31 20:24 ` David Lechner
  2025-01-31 20:24 ` [PATCH 05/13] gpio: max3191x: " David Lechner
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 37+ messages in thread
From: David Lechner @ 2025-01-31 20:24 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound, David Lechner

Reduce verbosity by using gpiods_set_array_value_cansleep() instead of
gpiods_set_array_value_cansleep().

ts_nbus->data->ndescs is validated to be 8 during probe, so will have
the same value as the hard-coded 8 that is removed by this change.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/bus/ts-nbus.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/bus/ts-nbus.c b/drivers/bus/ts-nbus.c
index d3ee102a13893c83c50e41f7298821f4d7ae3487..31ae9a26257c3e0af2ba99666e0c04e882da935b 100644
--- a/drivers/bus/ts-nbus.c
+++ b/drivers/bus/ts-nbus.c
@@ -109,8 +109,7 @@ static void ts_nbus_reset_bus(struct ts_nbus *ts_nbus)
 
 	values[0] = 0;
 
-	gpiod_set_array_value_cansleep(8, ts_nbus->data->desc,
-				       ts_nbus->data->info, values);
+	gpiods_set_array_value_cansleep(ts_nbus->data, values);
 	gpiod_set_value_cansleep(ts_nbus->csn, 0);
 	gpiod_set_value_cansleep(ts_nbus->strobe, 0);
 	gpiod_set_value_cansleep(ts_nbus->ale, 0);
@@ -150,12 +149,11 @@ static int ts_nbus_read_byte(struct ts_nbus *ts_nbus, u8 *val)
  */
 static void ts_nbus_write_byte(struct ts_nbus *ts_nbus, u8 byte)
 {
-	struct gpio_descs *gpios = ts_nbus->data;
 	DECLARE_BITMAP(values, 8);
 
 	values[0] = byte;
 
-	gpiod_set_array_value_cansleep(8, gpios->desc, gpios->info, values);
+	gpiods_set_array_value_cansleep(ts_nbus->data, values);
 }
 
 /*

-- 
2.43.0


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

* [PATCH 05/13] gpio: max3191x: use gpiods_set_array_value_cansleep
  2025-01-31 20:24 [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep David Lechner
                   ` (3 preceding siblings ...)
  2025-01-31 20:24 ` [PATCH 04/13] bus: ts-nbus: use gpiods_set_array_value_cansleep David Lechner
@ 2025-01-31 20:24 ` David Lechner
  2025-02-02 10:12   ` Andy Shevchenko
  2025-01-31 20:24 ` [PATCH 06/13] iio: adc: ad7606: " David Lechner
                   ` (10 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: David Lechner @ 2025-01-31 20:24 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound, David Lechner

Reduce verbosity by using gpiods_set_array_value_cansleep() instead of
gpiods_set_array_value_cansleep().

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/gpio/gpio-max3191x.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/gpio/gpio-max3191x.c b/drivers/gpio/gpio-max3191x.c
index bbacc714632b70e672a3d8494636fbc40dfea8ec..fee8dd2bd3c9eb7c06817430634eaf905cc9cbd8 100644
--- a/drivers/gpio/gpio-max3191x.c
+++ b/drivers/gpio/gpio-max3191x.c
@@ -309,23 +309,21 @@ static int max3191x_set_config(struct gpio_chip *gpio, unsigned int offset,
 	return 0;
 }
 
-static void gpiod_set_array_single_value_cansleep(unsigned int ndescs,
-						  struct gpio_desc **desc,
-						  struct gpio_array *info,
+static void gpiod_set_array_single_value_cansleep(struct gpio_descs *descs,
 						  int value)
 {
 	unsigned long *values;
 
-	values = bitmap_alloc(ndescs, GFP_KERNEL);
+	values = bitmap_alloc(descs->ndescs, GFP_KERNEL);
 	if (!values)
 		return;
 
 	if (value)
-		bitmap_fill(values, ndescs);
+		bitmap_fill(values, descs->ndescs);
 	else
-		bitmap_zero(values, ndescs);
+		bitmap_zero(values, descs->ndescs);
 
-	gpiod_set_array_value_cansleep(ndescs, desc, info, values);
+	gpiods_set_array_value_cansleep(descs, values);
 	bitmap_free(values);
 }
 
@@ -396,10 +394,8 @@ static int max3191x_probe(struct spi_device *spi)
 	max3191x->mode = device_property_read_bool(dev, "maxim,modesel-8bit")
 				 ? STATUS_BYTE_DISABLED : STATUS_BYTE_ENABLED;
 	if (max3191x->modesel_pins)
-		gpiod_set_array_single_value_cansleep(
-				 max3191x->modesel_pins->ndescs,
-				 max3191x->modesel_pins->desc,
-				 max3191x->modesel_pins->info, max3191x->mode);
+		gpiod_set_array_single_value_cansleep(max3191x->modesel_pins,
+						      max3191x->mode);
 
 	max3191x->ignore_uv = device_property_read_bool(dev,
 						  "maxim,ignore-undervoltage");

-- 
2.43.0


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

* [PATCH 06/13] iio: adc: ad7606: use gpiods_set_array_value_cansleep
  2025-01-31 20:24 [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep David Lechner
                   ` (4 preceding siblings ...)
  2025-01-31 20:24 ` [PATCH 05/13] gpio: max3191x: " David Lechner
@ 2025-01-31 20:24 ` David Lechner
  2025-01-31 20:24 ` [PATCH 07/13] iio: amplifiers: hmc425a: " David Lechner
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 37+ messages in thread
From: David Lechner @ 2025-01-31 20:24 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound, David Lechner

Reduce verbosity by using gpiods_set_array_value_cansleep() instead of
gpiods_set_array_value().

These are not called in an atomic context, so changing to the cansleep
variant is fine.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/iio/adc/ad7606.c     | 3 +--
 drivers/iio/adc/ad7606_spi.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c
index d8e3c7a43678c57470a5118715637a68b39125c1..fe2216fd072e375f3dd8096980e53074f8ee3758 100644
--- a/drivers/iio/adc/ad7606.c
+++ b/drivers/iio/adc/ad7606.c
@@ -818,8 +818,7 @@ static int ad7606_write_os_hw(struct iio_dev *indio_dev, int val)
 
 	values[0] = val & GENMASK(2, 0);
 
-	gpiod_set_array_value(st->gpio_os->ndescs, st->gpio_os->desc,
-			      st->gpio_os->info, values);
+	gpiods_set_array_value_cansleep(st->gpio_os, values);
 
 	/* AD7616 requires a reset to update value */
 	if (st->chip_info->os_req_reset)
diff --git a/drivers/iio/adc/ad7606_spi.c b/drivers/iio/adc/ad7606_spi.c
index e2c1475257065c98bf8e2512bda921d6d88a3002..d3064e452adfbc40b44f4437e76a73aeeb036ef0 100644
--- a/drivers/iio/adc/ad7606_spi.c
+++ b/drivers/iio/adc/ad7606_spi.c
@@ -297,8 +297,7 @@ static int ad7606B_sw_mode_config(struct iio_dev *indio_dev)
 	 * otherwise, they must be hardwired to VDD
 	 */
 	if (st->gpio_os) {
-		gpiod_set_array_value(st->gpio_os->ndescs,
-				      st->gpio_os->desc, st->gpio_os->info, os);
+		gpiods_set_array_value_cansleep(st->gpio_os, os);
 	}
 	/* OS of 128 and 256 are available only in software mode */
 	st->oversampling_avail = ad7606B_oversampling_avail;

-- 
2.43.0


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

* [PATCH 07/13] iio: amplifiers: hmc425a: use gpiods_set_array_value_cansleep
  2025-01-31 20:24 [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep David Lechner
                   ` (5 preceding siblings ...)
  2025-01-31 20:24 ` [PATCH 06/13] iio: adc: ad7606: " David Lechner
@ 2025-01-31 20:24 ` David Lechner
  2025-01-31 20:24 ` [PATCH 08/13] iio: resolver: ad2s1210: " David Lechner
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 37+ messages in thread
From: David Lechner @ 2025-01-31 20:24 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound, David Lechner

Reduce verbosity by using gpiods_set_array_value_cansleep() instead of
gpiods_set_array_value_cansleep().

Passing NULL as the 3rd argument to gpiod_set_array_value_cansleep()
only needs to be done if the array was constructed manually, which is
not the case here. This change effectively replaces that argument with
st->gpios->array_info. The possible side effect of this change is that
it could make setting the GPIOs more efficient.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/iio/amplifiers/hmc425a.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iio/amplifiers/hmc425a.c b/drivers/iio/amplifiers/hmc425a.c
index 2ee4c0d70281e24c1c818249b86d89ebe06d4876..e8c67c8145b1b9ccb9b70ccd3ce4f5de08f96e69 100644
--- a/drivers/iio/amplifiers/hmc425a.c
+++ b/drivers/iio/amplifiers/hmc425a.c
@@ -161,8 +161,7 @@ static int hmc425a_write(struct iio_dev *indio_dev, u32 value)
 
 	values[0] = value;
 
-	gpiod_set_array_value_cansleep(st->gpios->ndescs, st->gpios->desc,
-				       NULL, values);
+	gpiods_set_array_value_cansleep(st->gpios, values);
 	return 0;
 }
 

-- 
2.43.0


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

* [PATCH 08/13] iio: resolver: ad2s1210: use gpiods_set_array_value_cansleep
  2025-01-31 20:24 [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep David Lechner
                   ` (6 preceding siblings ...)
  2025-01-31 20:24 ` [PATCH 07/13] iio: amplifiers: hmc425a: " David Lechner
@ 2025-01-31 20:24 ` David Lechner
  2025-01-31 20:24 ` [PATCH 09/13] mmc: pwrseq_simple: " David Lechner
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 37+ messages in thread
From: David Lechner @ 2025-01-31 20:24 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound, David Lechner

Reduce verbosity by using gpiods_set_array_value_cansleep() instead of
gpiods_set_array_value().

These are not called in an atomic context, so changing to the cansleep
variant is fine.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/iio/resolver/ad2s1210.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/iio/resolver/ad2s1210.c b/drivers/iio/resolver/ad2s1210.c
index b681129a99b6cf399668bf01a1f5a15fbc4f95b8..938176ac7209a92180fe8d55191d4abce026afdd 100644
--- a/drivers/iio/resolver/ad2s1210.c
+++ b/drivers/iio/resolver/ad2s1210.c
@@ -182,8 +182,7 @@ static int ad2s1210_set_mode(struct ad2s1210_state *st, enum ad2s1210_mode mode)
 
 	bitmap[0] = mode;
 
-	return gpiod_set_array_value(gpios->ndescs, gpios->desc, gpios->info,
-				     bitmap);
+	return gpiods_set_array_value_cansleep(gpios, bitmap);
 }
 
 /*
@@ -1473,10 +1472,7 @@ static int ad2s1210_setup_gpios(struct ad2s1210_state *st)
 
 		bitmap[0] = st->resolution;
 
-		ret = gpiod_set_array_value(resolution_gpios->ndescs,
-					    resolution_gpios->desc,
-					    resolution_gpios->info,
-					    bitmap);
+		ret = gpiods_set_array_value_cansleep(resolution_gpios, bitmap);
 		if (ret < 0)
 			return dev_err_probe(dev, ret,
 					     "failed to set resolution gpios\n");

-- 
2.43.0


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

* [PATCH 09/13] mmc: pwrseq_simple: use gpiods_set_array_value_cansleep
  2025-01-31 20:24 [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep David Lechner
                   ` (7 preceding siblings ...)
  2025-01-31 20:24 ` [PATCH 08/13] iio: resolver: ad2s1210: " David Lechner
@ 2025-01-31 20:24 ` David Lechner
  2025-02-04 15:37   ` Ulf Hansson
  2025-01-31 20:24 ` [PATCH 10/13] mux: gpio: " David Lechner
                   ` (6 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: David Lechner @ 2025-01-31 20:24 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound, David Lechner

Reduce verbosity by using gpiods_set_array_value_cansleep() instead of
gpiods_set_array_value_cansleep().

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/mmc/core/pwrseq_simple.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mmc/core/pwrseq_simple.c b/drivers/mmc/core/pwrseq_simple.c
index 37cd858df0f4d7123683e1fe23a4c3fcd7817d13..b3a6d053c826741005f1484ad81df30b6bf75bbc 100644
--- a/drivers/mmc/core/pwrseq_simple.c
+++ b/drivers/mmc/core/pwrseq_simple.c
@@ -54,8 +54,7 @@ static void mmc_pwrseq_simple_set_gpios_value(struct mmc_pwrseq_simple *pwrseq,
 		else
 			bitmap_zero(values, nvalues);
 
-		gpiod_set_array_value_cansleep(nvalues, reset_gpios->desc,
-					       reset_gpios->info, values);
+		gpiods_set_array_value_cansleep(reset_gpios, values);
 
 		bitmap_free(values);
 	}

-- 
2.43.0


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

* [PATCH 10/13] mux: gpio: use gpiods_set_array_value_cansleep
  2025-01-31 20:24 [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep David Lechner
                   ` (8 preceding siblings ...)
  2025-01-31 20:24 ` [PATCH 09/13] mmc: pwrseq_simple: " David Lechner
@ 2025-01-31 20:24 ` David Lechner
  2025-02-01  0:34   ` Peter Rosin
  2025-01-31 20:24 ` [PATCH 11/13] net: mdio: mux-gpio: " David Lechner
                   ` (5 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: David Lechner @ 2025-01-31 20:24 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound, David Lechner

Reduce verbosity by using gpiods_set_array_value_cansleep() instead of
gpiods_set_array_value_cansleep().

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/mux/gpio.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mux/gpio.c b/drivers/mux/gpio.c
index cc5f2c1861d4a22d984bcd37efb98dd3561ee765..fdfb3407543dc3c2563750b013754ceb3390e39a 100644
--- a/drivers/mux/gpio.c
+++ b/drivers/mux/gpio.c
@@ -28,9 +28,7 @@ static int mux_gpio_set(struct mux_control *mux, int state)
 
 	bitmap_from_arr32(values, &value, BITS_PER_TYPE(value));
 
-	gpiod_set_array_value_cansleep(mux_gpio->gpios->ndescs,
-				       mux_gpio->gpios->desc,
-				       mux_gpio->gpios->info, values);
+	gpiods_set_array_value_cansleep(mux_gpio->gpios, values);
 
 	return 0;
 }

-- 
2.43.0


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

* [PATCH 11/13] net: mdio: mux-gpio: use gpiods_set_array_value_cansleep
  2025-01-31 20:24 [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep David Lechner
                   ` (9 preceding siblings ...)
  2025-01-31 20:24 ` [PATCH 10/13] mux: gpio: " David Lechner
@ 2025-01-31 20:24 ` David Lechner
  2025-01-31 20:24 ` [PATCH 12/13] phy: mapphone-mdm6600: " David Lechner
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 37+ messages in thread
From: David Lechner @ 2025-01-31 20:24 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound, David Lechner

Reduce verbosity by using gpiods_set_array_value_cansleep() instead of
gpiods_set_array_value_cansleep().

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/net/mdio/mdio-mux-gpio.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/mdio/mdio-mux-gpio.c b/drivers/net/mdio/mdio-mux-gpio.c
index ef77bd1abae984e5b1e51315de39cae33e0d063d..d7eaeadde2873977606bdcb5821dba18aa4a578f 100644
--- a/drivers/net/mdio/mdio-mux-gpio.c
+++ b/drivers/net/mdio/mdio-mux-gpio.c
@@ -30,8 +30,7 @@ static int mdio_mux_gpio_switch_fn(int current_child, int desired_child,
 
 	values[0] = desired_child;
 
-	gpiod_set_array_value_cansleep(s->gpios->ndescs, s->gpios->desc,
-				       s->gpios->info, values);
+	gpiods_set_array_value_cansleep(s->gpios, values);
 
 	return 0;
 }

-- 
2.43.0


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

* [PATCH 12/13] phy: mapphone-mdm6600: use gpiods_set_array_value_cansleep
  2025-01-31 20:24 [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep David Lechner
                   ` (10 preceding siblings ...)
  2025-01-31 20:24 ` [PATCH 11/13] net: mdio: mux-gpio: " David Lechner
@ 2025-01-31 20:24 ` David Lechner
  2025-02-02 10:20   ` Andy Shevchenko
  2025-01-31 20:24 ` [PATCH 13/13] ASoC: adau1701: " David Lechner
                   ` (3 subsequent siblings)
  15 siblings, 1 reply; 37+ messages in thread
From: David Lechner @ 2025-01-31 20:24 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound, David Lechner

Reduce verbosity by using gpiods_set_array_value_cansleep() instead of
gpiods_set_array_value_cansleep().

ddata->cmd_gpios->ndescs is validated to be equal to
PHY_MDM6600_NR_CMD_LINES during driver probe, so it will have the same
value as the previously hard-coded argument.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/phy/motorola/phy-mapphone-mdm6600.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/phy/motorola/phy-mapphone-mdm6600.c b/drivers/phy/motorola/phy-mapphone-mdm6600.c
index 152344e4f7e44de0f8ab1cae6ae01a1f1c5408e9..8243bab6ac3af2ee1394ef743aaad12a19c8ae36 100644
--- a/drivers/phy/motorola/phy-mapphone-mdm6600.c
+++ b/drivers/phy/motorola/phy-mapphone-mdm6600.c
@@ -177,9 +177,7 @@ static void phy_mdm6600_cmd(struct phy_mdm6600 *ddata, int val)
 
 	values[0] = val;
 
-	gpiod_set_array_value_cansleep(PHY_MDM6600_NR_CMD_LINES,
-				       ddata->cmd_gpios->desc,
-				       ddata->cmd_gpios->info, values);
+	gpiods_set_array_value_cansleep(ddata->cmd_gpios, values);
 }
 
 /**

-- 
2.43.0


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

* [PATCH 13/13] ASoC: adau1701: use gpiods_set_array_value_cansleep
  2025-01-31 20:24 [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep David Lechner
                   ` (11 preceding siblings ...)
  2025-01-31 20:24 ` [PATCH 12/13] phy: mapphone-mdm6600: " David Lechner
@ 2025-01-31 20:24 ` David Lechner
  2025-02-02 10:24   ` Andy Shevchenko
  2025-02-03 12:24   ` Mark Brown
  2025-01-31 20:38 ` [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep Andrew Lunn
                   ` (2 subsequent siblings)
  15 siblings, 2 replies; 37+ messages in thread
From: David Lechner @ 2025-01-31 20:24 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound, David Lechner

Reduce verbosity by using gpiods_set_array_value_cansleep() instead of
gpiods_set_array_value_cansleep().

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 sound/soc/codecs/adau1701.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sound/soc/codecs/adau1701.c b/sound/soc/codecs/adau1701.c
index 291249e0a2a32df7dde81904dce2f6be143fc2d7..d3e6b2763950f78143c0feb07c36764cb265441a 100644
--- a/sound/soc/codecs/adau1701.c
+++ b/sound/soc/codecs/adau1701.c
@@ -325,9 +325,7 @@ static int adau1701_reset(struct snd_soc_component *component, unsigned int clkd
 			__assign_bit(1, values, 1);
 			break;
 		}
-		gpiod_set_array_value_cansleep(adau1701->gpio_pll_mode->ndescs,
-				adau1701->gpio_pll_mode->desc, adau1701->gpio_pll_mode->info,
-				values);
+		gpiods_set_array_value_cansleep(adau1701->gpio_pll_mode, values);
 	}
 
 	adau1701->pll_clkdiv = clkdiv;

-- 
2.43.0


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

* Re: [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep
  2025-01-31 20:24 [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep David Lechner
                   ` (12 preceding siblings ...)
  2025-01-31 20:24 ` [PATCH 13/13] ASoC: adau1701: " David Lechner
@ 2025-01-31 20:38 ` Andrew Lunn
  2025-01-31 20:51   ` David Lechner
  2025-01-31 22:45 ` Linus Walleij
  2025-02-01 10:36 ` Bartosz Golaszewski
  15 siblings, 1 reply; 37+ messages in thread
From: Andrew Lunn @ 2025-01-31 20:38 UTC (permalink / raw)
  To: David Lechner
  Cc: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Heiner Kallweit,
	Russell King, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I, Nuno Sá,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound

> So I'm proposing that we add a gpiods_set_array_value_cansleep()
> function that is a wrapper around gpiod_set_array_value_cansleep()
> that has struct gpio_descs as the first parameter to make it a bit
> easier to read the code and avoid the hard-coding temptation.
 
This looks reasonable.

How do you plan to get it merged, since you cross a lot of subsystems
here.

	Andrew

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

* Re: [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep
  2025-01-31 20:38 ` [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep Andrew Lunn
@ 2025-01-31 20:51   ` David Lechner
  2025-02-01 12:45     ` Jonathan Cameron
  0 siblings, 1 reply; 37+ messages in thread
From: David Lechner @ 2025-01-31 20:51 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Heiner Kallweit,
	Russell King, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I, Nuno Sá,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound

On 1/31/25 2:38 PM, Andrew Lunn wrote:
>> So I'm proposing that we add a gpiods_set_array_value_cansleep()
>> function that is a wrapper around gpiod_set_array_value_cansleep()
>> that has struct gpio_descs as the first parameter to make it a bit
>> easier to read the code and avoid the hard-coding temptation.
>  
> This looks reasonable.
> 
> How do you plan to get it merged, since you cross a lot of subsystems
> here.
> 
> 	Andrew

Since these are mostly small changes and most of the touched drivers aren't
seeing much action, I think it would be OK for as much as possible to go through
the GPIO tree.

We might need an immutable branch from that though since I know that iio: adc:
ad7606 is currently being actively worked on.

If there are any patches leftover that don't get acked to go through the GPIO
tree, I can resubmit them after the next kernel release cycle since none of
this is urgent anyway.


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

* Re: [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep
  2025-01-31 20:24 [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep David Lechner
                   ` (13 preceding siblings ...)
  2025-01-31 20:38 ` [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep Andrew Lunn
@ 2025-01-31 22:45 ` Linus Walleij
  2025-02-01 10:36 ` Bartosz Golaszewski
  15 siblings, 0 replies; 37+ messages in thread
From: Linus Walleij @ 2025-01-31 22:45 UTC (permalink / raw)
  To: David Lechner
  Cc: Bartosz Golaszewski, Andy Shevchenko, Geert Uytterhoeven,
	Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Ulf Hansson, Peter Rosin, Andrew Lunn, Heiner Kallweit,
	Russell King, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I, Nuno Sá,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound

Hi David,

On Fri, Jan 31, 2025 at 9:24 PM David Lechner <dlechner@baylibre.com> wrote:

> This series was inspired by some minor annoyance I have experienced a
> few times in recent reviews.
>
> Calling gpiod_set_array_value_cansleep() can be quite verbose due to
> having so many parameters. In most cases, we already have a struct
> gpio_descs that contains the first 3 parameters so we end up with 3 (or
> often even 6) pointer indirections at each call site. Also, people have
> a tendency to want to hard-code the first argument instead of using
> struct gpio_descs.ndescs, often without checking that ndescs >= the
> hard-coded value.
>
> So I'm proposing that we add a gpiods_set_array_value_cansleep()
> function that is a wrapper around gpiod_set_array_value_cansleep()
> that has struct gpio_descs as the first parameter to make it a bit
> easier to read the code and avoid the hard-coding temptation.
>
> I've just done gpiods_set_array_value_cansleep() for now since there
> were over 10 callers of this one. There aren't as many callers of
> the get and atomic variants, but we can add those too if this seems
> like a useful thing to do.

I like it.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

for the series.

Yours,
Linus Walleij

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

* Re: [PATCH 10/13] mux: gpio: use gpiods_set_array_value_cansleep
  2025-01-31 20:24 ` [PATCH 10/13] mux: gpio: " David Lechner
@ 2025-02-01  0:34   ` Peter Rosin
  0 siblings, 0 replies; 37+ messages in thread
From: Peter Rosin @ 2025-02-01  0:34 UTC (permalink / raw)
  To: David Lechner, Linus Walleij, Bartosz Golaszewski,
	Andy Shevchenko, Geert Uytterhoeven, Lars-Peter Clausen,
	Michael Hennerich, Jonathan Cameron, Ulf Hansson, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound

Hi!

2025-01-31 at 21:24, David Lechner wrote:
> Reduce verbosity by using gpiods_set_array_value_cansleep() instead of
> gpiods_set_array_value_cansleep().
> 
> Signed-off-by: David Lechner <dlechner@baylibre.com>

Looks good to me.

Acked-by: Peter Rosin <peda@axentia.se>

Cheers,
Peter

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

* Re: [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep
  2025-01-31 20:24 [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep David Lechner
                   ` (14 preceding siblings ...)
  2025-01-31 22:45 ` Linus Walleij
@ 2025-02-01 10:36 ` Bartosz Golaszewski
  2025-02-01 15:10   ` Andy Shevchenko
  2025-02-01 16:09   ` David Lechner
  15 siblings, 2 replies; 37+ messages in thread
From: Bartosz Golaszewski @ 2025-02-01 10:36 UTC (permalink / raw)
  To: David Lechner
  Cc: linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound, Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai

On Fri, 31 Jan 2025 21:24:40 +0100, David Lechner <dlechner@baylibre.com> said:
> This series was inspired by some minor annoyance I have experienced a
> few times in recent reviews.
>
> Calling gpiod_set_array_value_cansleep() can be quite verbose due to
> having so many parameters. In most cases, we already have a struct
> gpio_descs that contains the first 3 parameters so we end up with 3 (or
> often even 6) pointer indirections at each call site. Also, people have
> a tendency to want to hard-code the first argument instead of using
> struct gpio_descs.ndescs, often without checking that ndescs >= the
> hard-coded value.
>
> So I'm proposing that we add a gpiods_set_array_value_cansleep()
> function that is a wrapper around gpiod_set_array_value_cansleep()
> that has struct gpio_descs as the first parameter to make it a bit
> easier to read the code and avoid the hard-coding temptation.
>
> I've just done gpiods_set_array_value_cansleep() for now since there
> were over 10 callers of this one. There aren't as many callers of
> the get and atomic variants, but we can add those too if this seems
> like a useful thing to do.
>
> ---
> David Lechner (13):
>       gpiolib: add gpiods_set_array_value_cansleep()
>       auxdisplay: seg-led-gpio: use gpiods_set_array_value_cansleep
>       bus: ts-nbus: validate ts,data-gpios array size
>       bus: ts-nbus: use gpiods_set_array_value_cansleep
>       gpio: max3191x: use gpiods_set_array_value_cansleep
>       iio: adc: ad7606: use gpiods_set_array_value_cansleep
>       iio: amplifiers: hmc425a: use gpiods_set_array_value_cansleep
>       iio: resolver: ad2s1210: use gpiods_set_array_value_cansleep
>       mmc: pwrseq_simple: use gpiods_set_array_value_cansleep
>       mux: gpio: use gpiods_set_array_value_cansleep
>       net: mdio: mux-gpio: use gpiods_set_array_value_cansleep
>       phy: mapphone-mdm6600: use gpiods_set_array_value_cansleep
>       ASoC: adau1701: use gpiods_set_array_value_cansleep
>
>  drivers/auxdisplay/seg-led-gpio.c           |  3 +--
>  drivers/bus/ts-nbus.c                       | 10 ++++++----
>  drivers/gpio/gpio-max3191x.c                | 18 +++++++-----------
>  drivers/iio/adc/ad7606.c                    |  3 +--
>  drivers/iio/adc/ad7606_spi.c                |  3 +--
>  drivers/iio/amplifiers/hmc425a.c            |  3 +--
>  drivers/iio/resolver/ad2s1210.c             |  8 ++------
>  drivers/mmc/core/pwrseq_simple.c            |  3 +--
>  drivers/mux/gpio.c                          |  4 +---
>  drivers/net/mdio/mdio-mux-gpio.c            |  3 +--
>  drivers/phy/motorola/phy-mapphone-mdm6600.c |  4 +---
>  include/linux/gpio/consumer.h               |  7 +++++++
>  sound/soc/codecs/adau1701.c                 |  4 +---
>  13 files changed, 31 insertions(+), 42 deletions(-)
> ---
> base-commit: df4b2bbff898227db0c14264ac7edd634e79f755
> change-id: 20250131-gpio-set-array-helper-bd4a328370d3
>
> Best regards,
> --
> David Lechner <dlechner@baylibre.com>
>
>

This looks good to me except for one thing: the function prefix. I would
really appreciate it if we could stay within the existing gpiod_ namespace and
not add a new one in the form of gpiods_.

Maybe: gpiod_multiple_set_ or gpiod_collected_set...?

Bartosz

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

* Re: [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep
  2025-01-31 20:51   ` David Lechner
@ 2025-02-01 12:45     ` Jonathan Cameron
  0 siblings, 0 replies; 37+ messages in thread
From: Jonathan Cameron @ 2025-02-01 12:45 UTC (permalink / raw)
  To: David Lechner
  Cc: Andrew Lunn, Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Ulf Hansson, Peter Rosin, Heiner Kallweit, Russell King,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Vinod Koul, Kishon Vijay Abraham I, Nuno Sá, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, linux-gpio,
	linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound

On Fri, 31 Jan 2025 14:51:52 -0600
David Lechner <dlechner@baylibre.com> wrote:

> On 1/31/25 2:38 PM, Andrew Lunn wrote:
> >> So I'm proposing that we add a gpiods_set_array_value_cansleep()
> >> function that is a wrapper around gpiod_set_array_value_cansleep()
> >> that has struct gpio_descs as the first parameter to make it a bit
> >> easier to read the code and avoid the hard-coding temptation.  
> >  
> > This looks reasonable.
> > 
> > How do you plan to get it merged, since you cross a lot of subsystems
> > here.
> > 
> > 	Andrew  
> 
> Since these are mostly small changes and most of the touched drivers aren't
> seeing much action, I think it would be OK for as much as possible to go through
> the GPIO tree.
> 
> We might need an immutable branch from that though since I know that iio: adc:
> ad7606 is currently being actively worked on.
Looks good to me (subject to requested name change from Bartosz)
I'd suggest an immutable with patch 1 then up to each subsystem
maintainer to pick that up or wait for next cycle.

Always hard to predict what else will get worked on at this stage
of a cycle.

Jonathan


> 
> If there are any patches leftover that don't get acked to go through the GPIO
> tree, I can resubmit them after the next kernel release cycle since none of
> this is urgent anyway.
> 


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

* Re: [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep
  2025-02-01 10:36 ` Bartosz Golaszewski
@ 2025-02-01 15:10   ` Andy Shevchenko
  2025-02-01 16:09   ` David Lechner
  1 sibling, 0 replies; 37+ messages in thread
From: Andy Shevchenko @ 2025-02-01 15:10 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: David Lechner, linux-gpio, linux-kernel, linux-iio, linux-mmc,
	netdev, linux-phy, linux-sound, Linus Walleij, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai

On Sat, Feb 1, 2025 at 12:36 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> On Fri, 31 Jan 2025 21:24:40 +0100, David Lechner <dlechner@baylibre.com> said:
> > This series was inspired by some minor annoyance I have experienced a
> > few times in recent reviews.
> >
> > Calling gpiod_set_array_value_cansleep() can be quite verbose due to
> > having so many parameters. In most cases, we already have a struct
> > gpio_descs that contains the first 3 parameters so we end up with 3 (or
> > often even 6) pointer indirections at each call site. Also, people have
> > a tendency to want to hard-code the first argument instead of using
> > struct gpio_descs.ndescs, often without checking that ndescs >= the
> > hard-coded value.
> >
> > So I'm proposing that we add a gpiods_set_array_value_cansleep()
> > function that is a wrapper around gpiod_set_array_value_cansleep()
> > that has struct gpio_descs as the first parameter to make it a bit
> > easier to read the code and avoid the hard-coding temptation.
> >
> > I've just done gpiods_set_array_value_cansleep() for now since there
> > were over 10 callers of this one. There aren't as many callers of
> > the get and atomic variants, but we can add those too if this seems
> > like a useful thing to do.

> This looks good to me except for one thing: the function prefix. I would
> really appreciate it if we could stay within the existing gpiod_ namespace and
> not add a new one in the form of gpiods_.
>
> Maybe: gpiod_multiple_set_ or gpiod_collected_set...?

+1 here, i.e. I like the idea, but the naming needs to be amended.

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep
  2025-02-01 10:36 ` Bartosz Golaszewski
  2025-02-01 15:10   ` Andy Shevchenko
@ 2025-02-01 16:09   ` David Lechner
  2025-02-01 16:14     ` Bartosz Golaszewski
  1 sibling, 1 reply; 37+ messages in thread
From: David Lechner @ 2025-02-01 16:09 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound, Linus Walleij, Andy Shevchenko, Geert Uytterhoeven,
	Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Ulf Hansson, Peter Rosin, Andrew Lunn, Heiner Kallweit,
	Russell King, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I, Nuno Sá,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai

On 2/1/25 4:36 AM, Bartosz Golaszewski wrote:
> On Fri, 31 Jan 2025 21:24:40 +0100, David Lechner <dlechner@baylibre.com> said:
>> This series was inspired by some minor annoyance I have experienced a
>> few times in recent reviews.
>>
>> Calling gpiod_set_array_value_cansleep() can be quite verbose due to
>> having so many parameters. In most cases, we already have a struct
>> gpio_descs that contains the first 3 parameters so we end up with 3 (or
>> often even 6) pointer indirections at each call site. Also, people have
>> a tendency to want to hard-code the first argument instead of using
>> struct gpio_descs.ndescs, often without checking that ndescs >= the
>> hard-coded value.
>>
>> So I'm proposing that we add a gpiods_set_array_value_cansleep()
>> function that is a wrapper around gpiod_set_array_value_cansleep()
>> that has struct gpio_descs as the first parameter to make it a bit
>> easier to read the code and avoid the hard-coding temptation.
>>
>> I've just done gpiods_set_array_value_cansleep() for now since there
>> were over 10 callers of this one. There aren't as many callers of
>> the get and atomic variants, but we can add those too if this seems
>> like a useful thing to do.
>>
>> ---
>> David Lechner (13):
>>       gpiolib: add gpiods_set_array_value_cansleep()
>>       auxdisplay: seg-led-gpio: use gpiods_set_array_value_cansleep
>>       bus: ts-nbus: validate ts,data-gpios array size
>>       bus: ts-nbus: use gpiods_set_array_value_cansleep
>>       gpio: max3191x: use gpiods_set_array_value_cansleep
>>       iio: adc: ad7606: use gpiods_set_array_value_cansleep
>>       iio: amplifiers: hmc425a: use gpiods_set_array_value_cansleep
>>       iio: resolver: ad2s1210: use gpiods_set_array_value_cansleep
>>       mmc: pwrseq_simple: use gpiods_set_array_value_cansleep
>>       mux: gpio: use gpiods_set_array_value_cansleep
>>       net: mdio: mux-gpio: use gpiods_set_array_value_cansleep
>>       phy: mapphone-mdm6600: use gpiods_set_array_value_cansleep
>>       ASoC: adau1701: use gpiods_set_array_value_cansleep
>>
>>  drivers/auxdisplay/seg-led-gpio.c           |  3 +--
>>  drivers/bus/ts-nbus.c                       | 10 ++++++----
>>  drivers/gpio/gpio-max3191x.c                | 18 +++++++-----------
>>  drivers/iio/adc/ad7606.c                    |  3 +--
>>  drivers/iio/adc/ad7606_spi.c                |  3 +--
>>  drivers/iio/amplifiers/hmc425a.c            |  3 +--
>>  drivers/iio/resolver/ad2s1210.c             |  8 ++------
>>  drivers/mmc/core/pwrseq_simple.c            |  3 +--
>>  drivers/mux/gpio.c                          |  4 +---
>>  drivers/net/mdio/mdio-mux-gpio.c            |  3 +--
>>  drivers/phy/motorola/phy-mapphone-mdm6600.c |  4 +---
>>  include/linux/gpio/consumer.h               |  7 +++++++
>>  sound/soc/codecs/adau1701.c                 |  4 +---
>>  13 files changed, 31 insertions(+), 42 deletions(-)
>> ---
>> base-commit: df4b2bbff898227db0c14264ac7edd634e79f755
>> change-id: 20250131-gpio-set-array-helper-bd4a328370d3
>>
>> Best regards,
>> --
>> David Lechner <dlechner@baylibre.com>
>>
>>
> 
> This looks good to me except for one thing: the function prefix. I would
> really appreciate it if we could stay within the existing gpiod_ namespace and
> not add a new one in the form of gpiods_.
> 
> Maybe: gpiod_multiple_set_ or gpiod_collected_set...?
> 
> Bartosz

I was waiting for someone to complain about the naming. ;-)

I was going for as short as possible, but OK, the most obvious prefix to me
would be `gpio_descs_...` (to match the first parameter). Any objections to
that?


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

* Re: [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep
  2025-02-01 16:09   ` David Lechner
@ 2025-02-01 16:14     ` Bartosz Golaszewski
  2025-02-01 16:17       ` David Lechner
  0 siblings, 1 reply; 37+ messages in thread
From: Bartosz Golaszewski @ 2025-02-01 16:14 UTC (permalink / raw)
  To: David Lechner
  Cc: linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound, Linus Walleij, Andy Shevchenko, Geert Uytterhoeven,
	Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Ulf Hansson, Peter Rosin, Andrew Lunn, Heiner Kallweit,
	Russell King, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I, Nuno Sá,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai

On Sat, Feb 1, 2025 at 5:09 PM David Lechner <dlechner@baylibre.com> wrote:
>
> On 2/1/25 4:36 AM, Bartosz Golaszewski wrote:
> >
> > This looks good to me except for one thing: the function prefix. I would
> > really appreciate it if we could stay within the existing gpiod_ namespace and
> > not add a new one in the form of gpiods_.
> >
> > Maybe: gpiod_multiple_set_ or gpiod_collected_set...?
> >
> > Bartosz
>
> I was waiting for someone to complain about the naming. ;-)
>
> I was going for as short as possible, but OK, the most obvious prefix to me
> would be `gpio_descs_...` (to match the first parameter). Any objections to
> that?
>

Yes, objection! As far as any exported interfaces go: in my book
"gpio_" is the prefix for legacy symbols we want to go away and
"gpiod_" is the prefix for current, descriptor-based API. Anything
else is a no-go. I prefer a longer name that starts with gpiod_ over
anything that's shorter but doesn't.

Bartosz

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

* Re: [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep
  2025-02-01 16:14     ` Bartosz Golaszewski
@ 2025-02-01 16:17       ` David Lechner
  2025-02-01 16:22         ` Bartosz Golaszewski
  0 siblings, 1 reply; 37+ messages in thread
From: David Lechner @ 2025-02-01 16:17 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound, Linus Walleij, Andy Shevchenko, Geert Uytterhoeven,
	Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Ulf Hansson, Peter Rosin, Andrew Lunn, Heiner Kallweit,
	Russell King, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I, Nuno Sá,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai

On 2/1/25 10:14 AM, Bartosz Golaszewski wrote:
> On Sat, Feb 1, 2025 at 5:09 PM David Lechner <dlechner@baylibre.com> wrote:
>>
>> On 2/1/25 4:36 AM, Bartosz Golaszewski wrote:
>>>
>>> This looks good to me except for one thing: the function prefix. I would
>>> really appreciate it if we could stay within the existing gpiod_ namespace and
>>> not add a new one in the form of gpiods_.
>>>
>>> Maybe: gpiod_multiple_set_ or gpiod_collected_set...?
>>>
>>> Bartosz
>>
>> I was waiting for someone to complain about the naming. ;-)
>>
>> I was going for as short as possible, but OK, the most obvious prefix to me
>> would be `gpio_descs_...` (to match the first parameter). Any objections to
>> that?
>>
> 
> Yes, objection! As far as any exported interfaces go: in my book
> "gpio_" is the prefix for legacy symbols we want to go away and
> "gpiod_" is the prefix for current, descriptor-based API. Anything
> else is a no-go. I prefer a longer name that starts with gpiod_ over
> anything that's shorter but doesn't.
> 
> Bartosz

Oops, that was a typo. I meant to write gpiod_descs_.

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

* Re: [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep
  2025-02-01 16:17       ` David Lechner
@ 2025-02-01 16:22         ` Bartosz Golaszewski
  2025-02-01 19:47           ` Andy Shevchenko
  0 siblings, 1 reply; 37+ messages in thread
From: Bartosz Golaszewski @ 2025-02-01 16:22 UTC (permalink / raw)
  To: David Lechner
  Cc: linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound, Linus Walleij, Andy Shevchenko, Geert Uytterhoeven,
	Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Ulf Hansson, Peter Rosin, Andrew Lunn, Heiner Kallweit,
	Russell King, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I, Nuno Sá,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai

On Sat, Feb 1, 2025 at 5:17 PM David Lechner <dlechner@baylibre.com> wrote:
>
> On 2/1/25 10:14 AM, Bartosz Golaszewski wrote:
> > On Sat, Feb 1, 2025 at 5:09 PM David Lechner <dlechner@baylibre.com> wrote:
> >>
> >> On 2/1/25 4:36 AM, Bartosz Golaszewski wrote:
> >>>
> >>> This looks good to me except for one thing: the function prefix. I would
> >>> really appreciate it if we could stay within the existing gpiod_ namespace and
> >>> not add a new one in the form of gpiods_.
> >>>
> >>> Maybe: gpiod_multiple_set_ or gpiod_collected_set...?
> >>>
> >>> Bartosz
> >>
> >> I was waiting for someone to complain about the naming. ;-)
> >>
> >> I was going for as short as possible, but OK, the most obvious prefix to me
> >> would be `gpio_descs_...` (to match the first parameter). Any objections to
> >> that?
> >>
> >
> > Yes, objection! As far as any exported interfaces go: in my book
> > "gpio_" is the prefix for legacy symbols we want to go away and
> > "gpiod_" is the prefix for current, descriptor-based API. Anything
> > else is a no-go. I prefer a longer name that starts with gpiod_ over
> > anything that's shorter but doesn't.
> >
> > Bartosz
>
> Oops, that was a typo. I meant to write gpiod_descs_.

Eh... the D in gpioD already stands for "GPIO Descriptor" but if
there's no better option in your opinion than I guess I can live with
that.

Bart

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

* Re: [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep
  2025-02-01 16:22         ` Bartosz Golaszewski
@ 2025-02-01 19:47           ` Andy Shevchenko
  2025-02-03 22:39             ` David Lechner
  0 siblings, 1 reply; 37+ messages in thread
From: Andy Shevchenko @ 2025-02-01 19:47 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: David Lechner, linux-gpio, linux-kernel, linux-iio, linux-mmc,
	netdev, linux-phy, linux-sound, Linus Walleij, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai

On Sat, Feb 1, 2025 at 6:22 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> On Sat, Feb 1, 2025 at 5:17 PM David Lechner <dlechner@baylibre.com> wrote:
> > On 2/1/25 10:14 AM, Bartosz Golaszewski wrote:
> > > On Sat, Feb 1, 2025 at 5:09 PM David Lechner <dlechner@baylibre.com> wrote:
> > >> On 2/1/25 4:36 AM, Bartosz Golaszewski wrote:

...

> > >>> This looks good to me except for one thing: the function prefix. I would
> > >>> really appreciate it if we could stay within the existing gpiod_ namespace and
> > >>> not add a new one in the form of gpiods_.
> > >>>
> > >>> Maybe: gpiod_multiple_set_ or gpiod_collected_set...?
> > >>
> > >> I was waiting for someone to complain about the naming. ;-)
> > >>
> > >> I was going for as short as possible, but OK, the most obvious prefix to me
> > >> would be `gpio_descs_...` (to match the first parameter). Any objections to
> > >> that?
> > >
> > > Yes, objection! As far as any exported interfaces go: in my book
> > > "gpio_" is the prefix for legacy symbols we want to go away and
> > > "gpiod_" is the prefix for current, descriptor-based API. Anything
> > > else is a no-go. I prefer a longer name that starts with gpiod_ over
> > > anything that's shorter but doesn't.
> >
> > Oops, that was a typo. I meant to write gpiod_descs_.
>
> Eh... the D in gpioD already stands for "GPIO Descriptor" but if
> there's no better option in your opinion than I guess I can live with
> that.

gpiod_set_many_value_cansleep() ?

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH 01/13] gpiolib: add gpiods_set_array_value_cansleep()
  2025-01-31 20:24 ` [PATCH 01/13] gpiolib: add gpiods_set_array_value_cansleep() David Lechner
@ 2025-02-02 10:06   ` Andy Shevchenko
  0 siblings, 0 replies; 37+ messages in thread
From: Andy Shevchenko @ 2025-02-02 10:06 UTC (permalink / raw)
  To: David Lechner
  Cc: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, linux-gpio, linux-kernel, linux-iio, linux-mmc,
	netdev, linux-phy, linux-sound

On Fri, Jan 31, 2025 at 10:24 PM David Lechner <dlechner@baylibre.com> wrote:
>
> Add a new gpiods_set_array_value_cansleep() helper function with fewer
> parameters than gpiod_set_array_value_cansleep().
>
> Calling gpiod_set_array_value_cansleep() can get quite verbose. In many
> cases, the first arguments all come from the same struct gpio_descs, so
> having a separate function where we can just pass that cuts down on the
> boilerplate.

...

> +static inline int gpiods_set_array_value_cansleep(struct gpio_descs *descs,
> +                                                 unsigned long *value_bitmap)

My proposal was to make this gpiod_set_many_value_cansleep(), but I'm
not pretending it's the best choice.

> +{
> +       return gpiod_set_array_value_cansleep(descs->ndescs, descs->desc,
> +                                             descs->info, value_bitmap);
> +}

I don't remember seeing the _bitmap suffix in other GPIO APIs, perhaps
just drop it?

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH 02/13] auxdisplay: seg-led-gpio: use gpiods_set_array_value_cansleep
  2025-01-31 20:24 ` [PATCH 02/13] auxdisplay: seg-led-gpio: use gpiods_set_array_value_cansleep David Lechner
@ 2025-02-02 10:08   ` Andy Shevchenko
  2025-02-03 10:34   ` Geert Uytterhoeven
  1 sibling, 0 replies; 37+ messages in thread
From: Andy Shevchenko @ 2025-02-02 10:08 UTC (permalink / raw)
  To: David Lechner
  Cc: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, linux-gpio, linux-kernel, linux-iio, linux-mmc,
	netdev, linux-phy, linux-sound

On Fri, Jan 31, 2025 at 10:24 PM David Lechner <dlechner@baylibre.com> wrote:
>
> Reduce verbosity by using gpiods_set_array_value_cansleep() instead of
> gpiods_set_array_value_cansleep().

Acked-by: Andy Shevchenko <andy@kernel.org>

Or if you want me to take it through the auxdisplay tree, please
provide the immutable tag/branch for the first patch.

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH 05/13] gpio: max3191x: use gpiods_set_array_value_cansleep
  2025-01-31 20:24 ` [PATCH 05/13] gpio: max3191x: " David Lechner
@ 2025-02-02 10:12   ` Andy Shevchenko
  0 siblings, 0 replies; 37+ messages in thread
From: Andy Shevchenko @ 2025-02-02 10:12 UTC (permalink / raw)
  To: David Lechner
  Cc: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, linux-gpio, linux-kernel, linux-iio, linux-mmc,
	netdev, linux-phy, linux-sound

On Fri, Jan 31, 2025 at 10:25 PM David Lechner <dlechner@baylibre.com> wrote:
>
> Reduce verbosity by using gpiods_set_array_value_cansleep() instead of
> gpiods_set_array_value_cansleep().

...

> -static void gpiod_set_array_single_value_cansleep(unsigned int ndescs,
> -                                                 struct gpio_desc **desc,
> -                                                 struct gpio_array *info,
> +static void gpiod_set_array_single_value_cansleep(struct gpio_descs *descs,
>                                                   int value)

This name puts its feet to the GPIO territory. Since you are changing
it, can you make sure it has a local namespace and not GPIO one?

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH 12/13] phy: mapphone-mdm6600: use gpiods_set_array_value_cansleep
  2025-01-31 20:24 ` [PATCH 12/13] phy: mapphone-mdm6600: " David Lechner
@ 2025-02-02 10:20   ` Andy Shevchenko
  0 siblings, 0 replies; 37+ messages in thread
From: Andy Shevchenko @ 2025-02-02 10:20 UTC (permalink / raw)
  To: David Lechner
  Cc: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, linux-gpio, linux-kernel, linux-iio, linux-mmc,
	netdev, linux-phy, linux-sound

On Fri, Jan 31, 2025 at 10:25 PM David Lechner <dlechner@baylibre.com> wrote:
>
> Reduce verbosity by using gpiods_set_array_value_cansleep() instead of
> gpiods_set_array_value_cansleep().
>
> ddata->cmd_gpios->ndescs is validated to be equal to
> PHY_MDM6600_NR_CMD_LINES during driver probe, so it will have the same
> value as the previously hard-coded argument.

...

> static void phy_mdm6600_cmd(struct phy_mdm6600 *ddata, int val)
>
>         values[0] = val;

FWIW, side note: this code is (potentially) buggy on BE 64-bit. Same
for the rest of similar cases, in case you want to address this...

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH 13/13] ASoC: adau1701: use gpiods_set_array_value_cansleep
  2025-01-31 20:24 ` [PATCH 13/13] ASoC: adau1701: " David Lechner
@ 2025-02-02 10:24   ` Andy Shevchenko
  2025-02-03 12:24   ` Mark Brown
  1 sibling, 0 replies; 37+ messages in thread
From: Andy Shevchenko @ 2025-02-02 10:24 UTC (permalink / raw)
  To: David Lechner
  Cc: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, linux-gpio, linux-kernel, linux-iio, linux-mmc,
	netdev, linux-phy, linux-sound

On Fri, Jan 31, 2025 at 10:25 PM David Lechner <dlechner@baylibre.com> wrote:
>
> Reduce verbosity by using gpiods_set_array_value_cansleep() instead of
> gpiods_set_array_value_cansleep().

...

>                         __assign_bit(1, values, 1);

Seems like an interesting way to say __set_bit().

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH 02/13] auxdisplay: seg-led-gpio: use gpiods_set_array_value_cansleep
  2025-01-31 20:24 ` [PATCH 02/13] auxdisplay: seg-led-gpio: use gpiods_set_array_value_cansleep David Lechner
  2025-02-02 10:08   ` Andy Shevchenko
@ 2025-02-03 10:34   ` Geert Uytterhoeven
  2025-02-03 12:10     ` Andy Shevchenko
  1 sibling, 1 reply; 37+ messages in thread
From: Geert Uytterhoeven @ 2025-02-03 10:34 UTC (permalink / raw)
  To: David Lechner
  Cc: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Ulf Hansson, Peter Rosin, Andrew Lunn, Heiner Kallweit,
	Russell King, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I, Nuno Sá,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound

Hi David,

Thanks for your patch!

On Fri, 31 Jan 2025 at 21:24, David Lechner <dlechner@baylibre.com> wrote:
> Reduce verbosity by using gpiods_set_array_value_cansleep() instead of
> gpiods_set_array_value_cansleep().
  ^^^^^^
  gpiod

Am I really the first to notice you got this wrong in each and every patch? ;-)

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 02/13] auxdisplay: seg-led-gpio: use gpiods_set_array_value_cansleep
  2025-02-03 10:34   ` Geert Uytterhoeven
@ 2025-02-03 12:10     ` Andy Shevchenko
  0 siblings, 0 replies; 37+ messages in thread
From: Andy Shevchenko @ 2025-02-03 12:10 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: David Lechner, Linus Walleij, Bartosz Golaszewski,
	Andy Shevchenko, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, linux-gpio, linux-kernel, linux-iio, linux-mmc,
	netdev, linux-phy, linux-sound

On Mon, Feb 3, 2025 at 12:35 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Fri, 31 Jan 2025 at 21:24, David Lechner <dlechner@baylibre.com> wrote:
> > Reduce verbosity by using gpiods_set_array_value_cansleep() instead of
> > gpiods_set_array_value_cansleep().
>   ^^^^^^
>   gpiod
>
> Am I really the first to notice you got this wrong in each and every patch? ;-)

Who reads the commit messages? :-)

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH 13/13] ASoC: adau1701: use gpiods_set_array_value_cansleep
  2025-01-31 20:24 ` [PATCH 13/13] ASoC: adau1701: " David Lechner
  2025-02-02 10:24   ` Andy Shevchenko
@ 2025-02-03 12:24   ` Mark Brown
  1 sibling, 0 replies; 37+ messages in thread
From: Mark Brown @ 2025-02-03 12:24 UTC (permalink / raw)
  To: David Lechner
  Cc: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound

[-- Attachment #1: Type: text/plain, Size: 216 bytes --]

On Fri, Jan 31, 2025 at 02:24:53PM -0600, David Lechner wrote:
> Reduce verbosity by using gpiods_set_array_value_cansleep() instead of
> gpiods_set_array_value_cansleep().

Acked-by: Mark Brown <broonie@kernel.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep
  2025-02-01 19:47           ` Andy Shevchenko
@ 2025-02-03 22:39             ` David Lechner
  2025-02-04  8:52               ` Bartosz Golaszewski
  0 siblings, 1 reply; 37+ messages in thread
From: David Lechner @ 2025-02-03 22:39 UTC (permalink / raw)
  To: Andy Shevchenko, Bartosz Golaszewski
  Cc: linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound, Linus Walleij, Andy Shevchenko, Geert Uytterhoeven,
	Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Ulf Hansson, Peter Rosin, Andrew Lunn, Heiner Kallweit,
	Russell King, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I, Nuno Sá,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai

On 2/1/25 1:47 PM, Andy Shevchenko wrote:
> On Sat, Feb 1, 2025 at 6:22 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>> On Sat, Feb 1, 2025 at 5:17 PM David Lechner <dlechner@baylibre.com> wrote:
>>> On 2/1/25 10:14 AM, Bartosz Golaszewski wrote:
>>>> On Sat, Feb 1, 2025 at 5:09 PM David Lechner <dlechner@baylibre.com> wrote:
>>>>> On 2/1/25 4:36 AM, Bartosz Golaszewski wrote:
> 
> ...
> 
>>>>>> This looks good to me except for one thing: the function prefix. I would
>>>>>> really appreciate it if we could stay within the existing gpiod_ namespace and
>>>>>> not add a new one in the form of gpiods_.
>>>>>>
>>>>>> Maybe: gpiod_multiple_set_ or gpiod_collected_set...?
>>>>>
>>>>> I was waiting for someone to complain about the naming. ;-)
>>>>>
>>>>> I was going for as short as possible, but OK, the most obvious prefix to me
>>>>> would be `gpio_descs_...` (to match the first parameter). Any objections to
>>>>> that?
>>>>
>>>> Yes, objection! As far as any exported interfaces go: in my book
>>>> "gpio_" is the prefix for legacy symbols we want to go away and
>>>> "gpiod_" is the prefix for current, descriptor-based API. Anything
>>>> else is a no-go. I prefer a longer name that starts with gpiod_ over
>>>> anything that's shorter but doesn't.
>>>
>>> Oops, that was a typo. I meant to write gpiod_descs_.
>>
>> Eh... the D in gpioD already stands for "GPIO Descriptor" but if
>> there's no better option in your opinion than I guess I can live with
>> that.
> 
> gpiod_set_many_value_cansleep() ?
> 

OK, taking all these suggestions into consideration along with having recently
come across regmap_multi_reg_write(), I think I'll go with:

gpiod_multi_set_value_cansleep()

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

* Re: [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep
  2025-02-03 22:39             ` David Lechner
@ 2025-02-04  8:52               ` Bartosz Golaszewski
  0 siblings, 0 replies; 37+ messages in thread
From: Bartosz Golaszewski @ 2025-02-04  8:52 UTC (permalink / raw)
  To: David Lechner
  Cc: Andy Shevchenko, linux-gpio, linux-kernel, linux-iio, linux-mmc,
	netdev, linux-phy, linux-sound, Linus Walleij, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Ulf Hansson, Peter Rosin, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I,
	Nuno Sá, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai

On Mon, Feb 3, 2025 at 11:39 PM David Lechner <dlechner@baylibre.com> wrote:
>
> On 2/1/25 1:47 PM, Andy Shevchenko wrote:
> > On Sat, Feb 1, 2025 at 6:22 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> >> On Sat, Feb 1, 2025 at 5:17 PM David Lechner <dlechner@baylibre.com> wrote:
> >>> On 2/1/25 10:14 AM, Bartosz Golaszewski wrote:
> >>>> On Sat, Feb 1, 2025 at 5:09 PM David Lechner <dlechner@baylibre.com> wrote:
> >>>>> On 2/1/25 4:36 AM, Bartosz Golaszewski wrote:
> >
> > ...
> >
> >>>>>> This looks good to me except for one thing: the function prefix. I would
> >>>>>> really appreciate it if we could stay within the existing gpiod_ namespace and
> >>>>>> not add a new one in the form of gpiods_.
> >>>>>>
> >>>>>> Maybe: gpiod_multiple_set_ or gpiod_collected_set...?
> >>>>>
> >>>>> I was waiting for someone to complain about the naming. ;-)
> >>>>>
> >>>>> I was going for as short as possible, but OK, the most obvious prefix to me
> >>>>> would be `gpio_descs_...` (to match the first parameter). Any objections to
> >>>>> that?
> >>>>
> >>>> Yes, objection! As far as any exported interfaces go: in my book
> >>>> "gpio_" is the prefix for legacy symbols we want to go away and
> >>>> "gpiod_" is the prefix for current, descriptor-based API. Anything
> >>>> else is a no-go. I prefer a longer name that starts with gpiod_ over
> >>>> anything that's shorter but doesn't.
> >>>
> >>> Oops, that was a typo. I meant to write gpiod_descs_.
> >>
> >> Eh... the D in gpioD already stands for "GPIO Descriptor" but if
> >> there's no better option in your opinion than I guess I can live with
> >> that.
> >
> > gpiod_set_many_value_cansleep() ?
> >
>
> OK, taking all these suggestions into consideration along with having recently
> come across regmap_multi_reg_write(), I think I'll go with:
>
> gpiod_multi_set_value_cansleep()

Sounds good.

Bart

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

* Re: [PATCH 09/13] mmc: pwrseq_simple: use gpiods_set_array_value_cansleep
  2025-01-31 20:24 ` [PATCH 09/13] mmc: pwrseq_simple: " David Lechner
@ 2025-02-04 15:37   ` Ulf Hansson
  0 siblings, 0 replies; 37+ messages in thread
From: Ulf Hansson @ 2025-02-04 15:37 UTC (permalink / raw)
  To: David Lechner
  Cc: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Geert Uytterhoeven, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, Peter Rosin, Andrew Lunn, Heiner Kallweit,
	Russell King, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Vinod Koul, Kishon Vijay Abraham I, Nuno Sá,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	linux-gpio, linux-kernel, linux-iio, linux-mmc, netdev, linux-phy,
	linux-sound

On Fri, 31 Jan 2025 at 21:25, David Lechner <dlechner@baylibre.com> wrote:
>
> Reduce verbosity by using gpiods_set_array_value_cansleep() instead of
> gpiods_set_array_value_cansleep().
>
> Signed-off-by: David Lechner <dlechner@baylibre.com>

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

> ---
>  drivers/mmc/core/pwrseq_simple.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/core/pwrseq_simple.c b/drivers/mmc/core/pwrseq_simple.c
> index 37cd858df0f4d7123683e1fe23a4c3fcd7817d13..b3a6d053c826741005f1484ad81df30b6bf75bbc 100644
> --- a/drivers/mmc/core/pwrseq_simple.c
> +++ b/drivers/mmc/core/pwrseq_simple.c
> @@ -54,8 +54,7 @@ static void mmc_pwrseq_simple_set_gpios_value(struct mmc_pwrseq_simple *pwrseq,
>                 else
>                         bitmap_zero(values, nvalues);
>
> -               gpiod_set_array_value_cansleep(nvalues, reset_gpios->desc,
> -                                              reset_gpios->info, values);
> +               gpiods_set_array_value_cansleep(reset_gpios, values);
>
>                 bitmap_free(values);
>         }
>
> --
> 2.43.0
>

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

end of thread, other threads:[~2025-02-04 15:38 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-31 20:24 [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep David Lechner
2025-01-31 20:24 ` [PATCH 01/13] gpiolib: add gpiods_set_array_value_cansleep() David Lechner
2025-02-02 10:06   ` Andy Shevchenko
2025-01-31 20:24 ` [PATCH 02/13] auxdisplay: seg-led-gpio: use gpiods_set_array_value_cansleep David Lechner
2025-02-02 10:08   ` Andy Shevchenko
2025-02-03 10:34   ` Geert Uytterhoeven
2025-02-03 12:10     ` Andy Shevchenko
2025-01-31 20:24 ` [PATCH 03/13] bus: ts-nbus: validate ts,data-gpios array size David Lechner
2025-01-31 20:24 ` [PATCH 04/13] bus: ts-nbus: use gpiods_set_array_value_cansleep David Lechner
2025-01-31 20:24 ` [PATCH 05/13] gpio: max3191x: " David Lechner
2025-02-02 10:12   ` Andy Shevchenko
2025-01-31 20:24 ` [PATCH 06/13] iio: adc: ad7606: " David Lechner
2025-01-31 20:24 ` [PATCH 07/13] iio: amplifiers: hmc425a: " David Lechner
2025-01-31 20:24 ` [PATCH 08/13] iio: resolver: ad2s1210: " David Lechner
2025-01-31 20:24 ` [PATCH 09/13] mmc: pwrseq_simple: " David Lechner
2025-02-04 15:37   ` Ulf Hansson
2025-01-31 20:24 ` [PATCH 10/13] mux: gpio: " David Lechner
2025-02-01  0:34   ` Peter Rosin
2025-01-31 20:24 ` [PATCH 11/13] net: mdio: mux-gpio: " David Lechner
2025-01-31 20:24 ` [PATCH 12/13] phy: mapphone-mdm6600: " David Lechner
2025-02-02 10:20   ` Andy Shevchenko
2025-01-31 20:24 ` [PATCH 13/13] ASoC: adau1701: " David Lechner
2025-02-02 10:24   ` Andy Shevchenko
2025-02-03 12:24   ` Mark Brown
2025-01-31 20:38 ` [PATCH 00/13] gpiolib: add gpiods_set_array_value_cansleep Andrew Lunn
2025-01-31 20:51   ` David Lechner
2025-02-01 12:45     ` Jonathan Cameron
2025-01-31 22:45 ` Linus Walleij
2025-02-01 10:36 ` Bartosz Golaszewski
2025-02-01 15:10   ` Andy Shevchenko
2025-02-01 16:09   ` David Lechner
2025-02-01 16:14     ` Bartosz Golaszewski
2025-02-01 16:17       ` David Lechner
2025-02-01 16:22         ` Bartosz Golaszewski
2025-02-01 19:47           ` Andy Shevchenko
2025-02-03 22:39             ` David Lechner
2025-02-04  8:52               ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).