Commit a927e729 authored by David Lechner's avatar David Lechner Committed by Jonathan Cameron
Browse files

iio: amplifiers: hmc425a: use gpiod_multi_set_value_cansleep



Reduce verbosity by using gpiod_multi_set_value_cansleep() instead of
gpiod_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.

Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarDavid Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250210-gpio-set-array-helper-v3-8-d6a673674da8@baylibre.com


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent f23209e9
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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);
	gpiod_multi_set_value_cansleep(st->gpios, values);
	return 0;
}