Re: [PATCH v3 14/22] gpio: bd73800: Use named initializers for platform_device_id array
From: Matti Vaittinen
Date: Tue Oct 27 2026 - 02:05:42 EST
On 26/10/2026 18:28, 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
platform_device_id that replaces .driver_data by an anonymous union
(though this driver doesn't use .driver_data, so this patch isn't
strictly necessary for the plan, but still ok for consistency).
This patch doesn't modify the compiled array, only its representation
in source form benefits.
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@xxxxxxxxxxxx>
Reviewed-by: Matti Vaittinen <mazziesaccount@xxxxxxxxx>
Thanks!
---
drivers/gpio/gpio-bd73800.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-bd73800.c b/drivers/gpio/gpio-bd73800.c
index 2be2a885820e..c960ea6e8426 100644
--- a/drivers/gpio/gpio-bd73800.c
+++ b/drivers/gpio/gpio-bd73800.c
@@ -189,8 +189,8 @@ static int gpo_bd73800_probe(struct platform_device *pdev)
}
static const struct platform_device_id bd73800_gpio_id[] = {
- { "bd73800-gpio" },
- { },
+ { .name = "bd73800-gpio" },
+ { }
};
MODULE_DEVICE_TABLE(platform, bd73800_gpio_id);
--
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland
~~ When things go utterly wrong vim users can always type :help! ~~