[PATCH v2 17/23] mfd: Use named initializers for arrays of spi_device_id

Charles Keepax ckeepax at opensource.cirrus.com
Wed Jul 8 05:14:03 PDT 2026


On Wed, Jul 08, 2026 at 01:15:24PM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> While being less compact, using named initializers allows to more easily
> see which members of the structs are assigned which value without having
> to lookup the declaration of the struct. And it's also more robust
> against changes to the struct definition.
> 
> The mentioned robustness is relevant for a planned change to struct
> spi_device_id that replaces .driver_data by an anonymous union.
> 
> This patch doesn't modify the compiled arrays, only their representation
> in source form benefits.
> 
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig at baylibre.com>
> ---
>  drivers/mfd/arizona-spi.c       | 10 +++++-----
>  drivers/mfd/cs40l50-spi.c       |  2 +-
>  drivers/mfd/madera-spi.c        | 18 +++++++++---------
>  drivers/mfd/wm831x-spi.c        | 14 +++++++-------

Reviewed-by: Charles Keepax <ckeepax at opensource.cirrus.com>

Thanks,
Charles



More information about the linux-arm-kernel mailing list