[PATCH v3 01/17] spi: spi-mem: Add DTR templates for cmd, address, dummy and data phase

Tudor.Ambarus at microchip.com Tudor.Ambarus at microchip.com
Wed Jan 5 00:24:09 PST 2022


On 1/4/22 5:31 PM, Boris Brezillon wrote:
> -#define SPI_MEM_OP_DATA_IN(__nbytes, __buf, __buswidth)                \
> +#define SPI_MEM_OP_DATA_IN(__nbytes, __buf, __buswidth, ...)   \
>         {                                                       \
>                 .dir = SPI_MEM_DATA_IN,                         \
>                 .nbytes = __nbytes,                             \
>                 .buf.in = __buf,                                \
>                 .buswidth = __buswidth,                         \
> +               __VA_ARGS__                                     \
>         }
> 
> -#define SPI_MEM_OP_DATA_OUT(__nbytes, __buf, __buswidth)       \
> +#define SPI_MEM_OP_DATA_OUT(__nbytes, __buf, __buswidth, ...)  \
>         {                                                       \
>                 .dir = SPI_MEM_DATA_OUT,                        \
>                 .nbytes = __nbytes,                             \
>                 .buf.out = __buf,                               \
>                 .buswidth = __buswidth,                         \
> +               __VA_ARGS__                                   

I like it too. This also comes in handy when we'll have to differentiate
between register and memory accesses.

Cheers,
ta


More information about the linux-mtd mailing list