Re: [PATCH v1 1/1] regmap: spi: Use spi_message_init_with_transfers()
From: Mark Brown
Date: Mon Jul 10 2023 - 10:39:07 EST
On Mon, Jul 10, 2023 at 05:23:35PM +0300, Andy Shevchenko wrote:
> @@ -66,10 +64,7 @@ static int regmap_spi_async_write(void *context,
> async->t[1].tx_buf = val;
> async->t[1].len = val_len;
>
> - spi_message_init(&async->m);
> - spi_message_add_tail(&async->t[0], &async->m);
> - if (val)
> - spi_message_add_tail(&async->t[1], &async->m);
> + spi_message_init_with_transfers(&async->m, async->t, val ? 2 : 1);
I'm not sure this is a legibility win.
Attachment:
signature.asc
Description: PGP signature