rtc: 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.

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>
This commit is contained in:
Uwe Kleine-König (The Capable Hub)
2026-05-28 08:48:12 +02:00
committed by Alexandre Belloni
parent 6e2f1f0184
commit 041ca88844
6 changed files with 20 additions and 20 deletions

View 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);

View 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);

View 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);

View File

@@ -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);

View 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);

View 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);