[PATCH v2 16/23] mfd: Use named initializers for platform_device_id array

Linus Walleij linusw at kernel.org
Thu Jul 9 12:35:49 PDT 2026


On Wed, Jul 8, 2026 at 1:17 PM Uwe Kleine-König (The Capable Hub)
<u.kleine-koenig at baylibre.com> 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
> platform_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.
>
> Also drop a tailing comma after a list terminator to match the common
> style for these device-id arrays.
>
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig at baylibre.com>

Reviewed-by: Linus Walleij <linusw at kernel.org>

Yours,
Linus Walleij



More information about the Linux-mediatek mailing list