]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
rtc: Use named initializers for platform_device_id arrays
authorUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Thu, 28 May 2026 06:48:12 +0000 (08:48 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 22 Jun 2026 00:22:42 +0000 (02:22 +0200)
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.

While touching these arrays unify spacing and usage of commas.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Acked-by: Karel Balej <balejk@matfyz.cz> # for Marvell 88PM886
Link: https://patch.msgid.link/d14b9076b2c7703708bcc5cc35f339cd97fc10cd.1779950275.git.u.kleine-koenig@baylibre.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-88pm886.c
drivers/rtc/rtc-bd70528.c
drivers/rtc/rtc-max77686.c
drivers/rtc/rtc-max8998.c
drivers/rtc/rtc-s5m.c
drivers/rtc/rtc-tps6594.c

index 57e9b0a66eed4ecbb053e83f273d157664badc02..13aa3ae8223953ac30d8a790912c28e2dabc0892 100644 (file)
@@ -78,7 +78,7 @@ static int pm886_rtc_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id pm886_rtc_id_table[] = {
-       { "88pm886-rtc", },
+       { .name = "88pm886-rtc" },
        { }
 };
 MODULE_DEVICE_TABLE(platform, pm886_rtc_id_table);
index 4c8599761b2e5664b8a6d822c18575924a56c826..482810b61495dcd29f67697258705d771deec691 100644 (file)
@@ -341,10 +341,10 @@ static int bd70528_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id bd718x7_rtc_id[] = {
-       { "bd71828-rtc", ROHM_CHIP_TYPE_BD71828 },
-       { "bd71815-rtc", ROHM_CHIP_TYPE_BD71815 },
-       { "bd72720-rtc", ROHM_CHIP_TYPE_BD72720 },
-       { },
+       { .name = "bd71828-rtc", .driver_data = ROHM_CHIP_TYPE_BD71828 },
+       { .name = "bd71815-rtc", .driver_data = ROHM_CHIP_TYPE_BD71815 },
+       { .name = "bd72720-rtc", .driver_data = ROHM_CHIP_TYPE_BD72720 },
+       { }
 };
 MODULE_DEVICE_TABLE(platform, bd718x7_rtc_id);
 
index 3cdfd78a07ccc56b8881d2c18407ad314a1b863b..375565a3bddfb8a35e4198afd8c38dc97a196eb9 100644 (file)
@@ -866,11 +866,11 @@ static SIMPLE_DEV_PM_OPS(max77686_rtc_pm_ops,
                         max77686_rtc_suspend, max77686_rtc_resume);
 
 static const struct platform_device_id rtc_id[] = {
-       { "max77686-rtc", .driver_data = (kernel_ulong_t)&max77686_drv_data, },
-       { "max77802-rtc", .driver_data = (kernel_ulong_t)&max77802_drv_data, },
-       { "max77620-rtc", .driver_data = (kernel_ulong_t)&max77620_drv_data, },
-       { "max77714-rtc", .driver_data = (kernel_ulong_t)&max77714_drv_data, },
-       {},
+       { .name = "max77686-rtc", .driver_data = (kernel_ulong_t)&max77686_drv_data },
+       { .name = "max77802-rtc", .driver_data = (kernel_ulong_t)&max77802_drv_data },
+       { .name = "max77620-rtc", .driver_data = (kernel_ulong_t)&max77620_drv_data },
+       { .name = "max77714-rtc", .driver_data = (kernel_ulong_t)&max77714_drv_data },
+       { }
 };
 MODULE_DEVICE_TABLE(platform, rtc_id);
 
index c873b4509b3cfe9fa6a17ee826d67d586b7530a2..a2c946edcd1a960cd4b75a3be1a0e66a11fbbc0d 100644 (file)
@@ -299,8 +299,8 @@ no_irq:
 }
 
 static const struct platform_device_id max8998_rtc_id[] = {
-       { "max8998-rtc", TYPE_MAX8998 },
-       { "lp3974-rtc", TYPE_LP3974 },
+       { .name = "max8998-rtc", .driver_data = TYPE_MAX8998 },
+       { .name = "lp3974-rtc", .driver_data = TYPE_LP3974 },
        { }
 };
 MODULE_DEVICE_TABLE(platform, max8998_rtc_id);
index c6ed5a4ca8a0e4554b1c88c879b01fc384735007..aa706074ec3e794d4f5e6fccc9b2935ce0d28a8c 100644 (file)
@@ -807,12 +807,12 @@ static int s5m_rtc_suspend(struct device *dev)
 static SIMPLE_DEV_PM_OPS(s5m_rtc_pm_ops, s5m_rtc_suspend, s5m_rtc_resume);
 
 static const struct platform_device_id s5m_rtc_id[] = {
-       { "s5m-rtc",            S5M8767X },
-       { "s2mpg10-rtc",        S2MPG10 },
-       { "s2mps13-rtc",        S2MPS13X },
-       { "s2mps14-rtc",        S2MPS14X },
-       { "s2mps15-rtc",        S2MPS15X },
-       { },
+       { .name = "s5m-rtc",     .driver_data = S5M8767X },
+       { .name = "s2mpg10-rtc", .driver_data = S2MPG10 },
+       { .name = "s2mps13-rtc", .driver_data = S2MPS13X },
+       { .name = "s2mps14-rtc", .driver_data = S2MPS14X },
+       { .name = "s2mps15-rtc", .driver_data = S2MPS15X },
+       { }
 };
 MODULE_DEVICE_TABLE(platform, s5m_rtc_id);
 
index 7c6246e3f02923fcbc01349010166e5a12d58183..2cebd54c2dbf18cafab352f146c587c40322a0ad 100644 (file)
@@ -485,8 +485,8 @@ static int tps6594_rtc_suspend(struct device *dev)
 static DEFINE_SIMPLE_DEV_PM_OPS(tps6594_rtc_pm_ops, tps6594_rtc_suspend, tps6594_rtc_resume);
 
 static const struct platform_device_id tps6594_rtc_id_table[] = {
-       { "tps6594-rtc", },
-       {}
+       { .name = "tps6594-rtc" },
+       { }
 };
 MODULE_DEVICE_TABLE(platform, tps6594_rtc_id_table);