watchdog: Use named initializers for platform_device_id arrays

Named initializers are better readable and more robust to changes of the
struct definition. This robustness is relevant for a planned change to
struct platform_device_id replacing .driver_data by an anonymous union.

For one driver drop the unused assignment to .driver_data instead.

While touching these arrays unify spacing and usage of commas.

There is no effect on the compiled arrays.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/22bc09d0c9c8dfe75a205b0a9ccc98ccfba1de10.1781622532.git.u.kleine-koenig@baylibre.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
Uwe Kleine-König (The Capable Hub) 2026-06-16 17:25:10 +02:00 committed by Guenter Roeck
parent db2ddb8714
commit d4011cda7f
3 changed files with 12 additions and 12 deletions

View File

@ -178,8 +178,8 @@ static int __maybe_unused cros_ec_wdt_resume(struct platform_device *pdev)
}
static const struct platform_device_id cros_ec_wdt_id[] = {
{ DRV_NAME, 0 },
{}
{ .name = DRV_NAME },
{ }
};
static struct platform_driver cros_ec_wdt_driver = {

View File

@ -245,13 +245,13 @@ static int max63xx_wdt_probe(struct platform_device *pdev)
}
static const struct platform_device_id max63xx_id_table[] = {
{ "max6369_wdt", (kernel_ulong_t)max6369_table, },
{ "max6370_wdt", (kernel_ulong_t)max6369_table, },
{ "max6371_wdt", (kernel_ulong_t)max6371_table, },
{ "max6372_wdt", (kernel_ulong_t)max6371_table, },
{ "max6373_wdt", (kernel_ulong_t)max6373_table, },
{ "max6374_wdt", (kernel_ulong_t)max6373_table, },
{ },
{ .name = "max6369_wdt", .driver_data = (kernel_ulong_t)max6369_table },
{ .name = "max6370_wdt", .driver_data = (kernel_ulong_t)max6369_table },
{ .name = "max6371_wdt", .driver_data = (kernel_ulong_t)max6371_table },
{ .name = "max6372_wdt", .driver_data = (kernel_ulong_t)max6371_table },
{ .name = "max6373_wdt", .driver_data = (kernel_ulong_t)max6373_table },
{ .name = "max6374_wdt", .driver_data = (kernel_ulong_t)max6373_table },
{ }
};
MODULE_DEVICE_TABLE(platform, max63xx_id_table);

View File

@ -235,9 +235,9 @@ static int max77620_wdt_probe(struct platform_device *pdev)
}
static const struct platform_device_id max77620_wdt_devtype[] = {
{ "max77620-watchdog", (kernel_ulong_t)&max77620_wdt_data },
{ "max77714-watchdog", (kernel_ulong_t)&max77714_wdt_data },
{ },
{ .name = "max77620-watchdog", .driver_data = (kernel_ulong_t)&max77620_wdt_data },
{ .name = "max77714-watchdog", .driver_data = (kernel_ulong_t)&max77714_wdt_data },
{ }
};
MODULE_DEVICE_TABLE(platform, max77620_wdt_devtype);