Re: [PATCH v2 13/23] mfd: Use named initializers for arrays of i2c_device_id

Charles Keepax <[email protected]>
Newsgroups org.kernel.vger.linux-renesas-soc,dev.linux.lists.imx,dev.linux.lists.mfd,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-omap,org.kernel.vger.linux-sound
Message-ID <[email protected]>
On Wed, Jul 08, 2026 at 01:15:20PM +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
> i2c_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) <[email protected]>
> ---
>  drivers/mfd/arizona-i2c.c        | 12 ++++++------
>  drivers/mfd/cs40l50-i2c.c        |  2 +-
>  drivers/mfd/madera-i2c.c         | 18 +++++++++---------
>  drivers/mfd/wm831x-i2c.c         | 14 +++++++-------
>  drivers/mfd/wm8350-i2c.c         |  6 +++---
>  drivers/mfd/wm8400-core.c        |  2 +-
>  drivers/mfd/wm8994-core.c        |  8 ++++----

Reviewed-by: Charles Keepax <[email protected]>

Thanks,
Charles
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.