[PATCH v2 04/13] bus: ts-nbus: use gpiod_multi_set_value_cansleep
From: David Lechner
Date: Thu Feb 06 2025 - 17:50:05 EST
Reduce verbosity by using gpiod_multi_set_value_cansleep() instead of
gpiod_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.
Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
Signed-off-by: David Lechner <dlechner@xxxxxxxxxxxx>
---
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..b4c9308caf0647a3261071d9527fffce77784af2 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);
+ gpiod_multi_set_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);
+ gpiod_multi_set_value_cansleep(ts_nbus->data, values);
}
/*
--
2.43.0