[PATCH v1 3/3] rtc: Use named initializers for platform_device_id arrays

From: Uwe Kleine-König (The Capable Hub)

Date: Thu May 28 2026 - 02:48:57 EST


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@xxxxxxxxxxxx>
---
drivers/rtc/rtc-88pm886.c | 2 +-
drivers/rtc/rtc-bd70528.c | 8 ++++----
drivers/rtc/rtc-max77686.c | 10 +++++-----
drivers/rtc/rtc-max8998.c | 4 ++--
drivers/rtc/rtc-s5m.c | 12 ++++++------
drivers/rtc/rtc-tps6594.c | 4 ++--
6 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/rtc/rtc-88pm886.c b/drivers/rtc/rtc-88pm886.c
index 57e9b0a66eed..13aa3ae82239 100644
--- a/drivers/rtc/rtc-88pm886.c
+++ b/drivers/rtc/rtc-88pm886.c
@@ -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);
diff --git a/drivers/rtc/rtc-bd70528.c b/drivers/rtc/rtc-bd70528.c
index 4c8599761b2e..482810b61495 100644
--- a/drivers/rtc/rtc-bd70528.c
+++ b/drivers/rtc/rtc-bd70528.c
@@ -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);

diff --git a/drivers/rtc/rtc-max77686.c b/drivers/rtc/rtc-max77686.c
index 3cdfd78a07cc..375565a3bddf 100644
--- a/drivers/rtc/rtc-max77686.c
+++ b/drivers/rtc/rtc-max77686.c
@@ -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);

diff --git a/drivers/rtc/rtc-max8998.c b/drivers/rtc/rtc-max8998.c
index c873b4509b3c..a2c946edcd1a 100644
--- a/drivers/rtc/rtc-max8998.c
+++ b/drivers/rtc/rtc-max8998.c
@@ -299,8 +299,8 @@ static int max8998_rtc_probe(struct platform_device *pdev)
}

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);
diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
index c6ed5a4ca8a0..aa706074ec3e 100644
--- a/drivers/rtc/rtc-s5m.c
+++ b/drivers/rtc/rtc-s5m.c
@@ -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);

diff --git a/drivers/rtc/rtc-tps6594.c b/drivers/rtc/rtc-tps6594.c
index 7c6246e3f029..2cebd54c2dbf 100644
--- a/drivers/rtc/rtc-tps6594.c
+++ b/drivers/rtc/rtc-tps6594.c
@@ -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);

--
2.47.3