Re: [PATCH v2 04/13] bus: ts-nbus: use gpiod_multi_set_value_cansleep

From: Andy Shevchenko
Date: Fri Feb 07 2025 - 07:18:16 EST


On Fri, Feb 7, 2025 at 12:48 AM David Lechner <dlechner@xxxxxxxxxxxx> wrote:
>
> 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.

...

> static void ts_nbus_reset_bus(struct ts_nbus *ts_nbus)

> values[0] = 0;
> + gpiod_multi_set_value_cansleep(ts_nbus->data, values);

...

> 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);

As I said before, this is buggy code on BE64. Needs to be fixed.

> }


--
With Best Regards,
Andy Shevchenko