[tip: timers/clocksource] clocksource/drivers/sh_cmt: Use named initializers for platform_device_id arrays

tip-bot2 for Uwe Kleine-König (The Capable Hub) <[email protected]>
Newsgroups org.kernel.vger.linux-kernel
Message-ID <178695587711.1542179.13641694160929940758.tip-bot2@tip-bot2>
The following commit has been merged into the timers/clocksource branch of tip:

Commit-ID:     38c6b710926567aa696332a300e85b6cab56eac1
Gitweb:        https://git.kernel.org/tip/38c6b710926567aa696332a300e85b6cab56eac1
Author:        Uwe Kleine-König (The Capable Hub) <[email protected]>
AuthorDate:    Wed, 17 Jun 2026 11:24:11 +02:00
Committer:     Daniel Lezcano <[email protected]>
CommitterDate: Thu, 13 Aug 2026 18:12:29 +02:00

clocksource/drivers/sh_cmt: 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.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
Link: https://patch.msgid.link/6a6951b86f0e9a2ab4a378ab63edf7a487f1d693.1781687723.git.u.kleine-koenig@baylibre.com
---
 drivers/clocksource/sh_cmt.c | 4 ++--
 drivers/clocksource/sh_tmu.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index cf057f5..7977507 100644
--- a/drivers/clocksource/sh_cmt.c
+++ b/drivers/clocksource/sh_cmt.c
@@ -974,8 +974,8 @@ static int sh_cmt_map_memory(struct sh_cmt_device *cmt)
 }
 
 static const struct platform_device_id sh_cmt_id_table[] = {
-	{ "sh-cmt-16", (kernel_ulong_t)&sh_cmt_info[SH_CMT_16BIT] },
-	{ "sh-cmt-32", (kernel_ulong_t)&sh_cmt_info[SH_CMT_32BIT] },
+	{ .name = "sh-cmt-16", .driver_data = (kernel_ulong_t)&sh_cmt_info[SH_CMT_16BIT] },
+	{ .name = "sh-cmt-32", .driver_data = (kernel_ulong_t)&sh_cmt_info[SH_CMT_32BIT] },
 	{ }
 };
 MODULE_DEVICE_TABLE(platform, sh_cmt_id_table);
diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c
index 8d6a9e2..8b3cfa6 100644
--- a/drivers/clocksource/sh_tmu.c
+++ b/drivers/clocksource/sh_tmu.c
@@ -614,8 +614,8 @@ static int sh_tmu_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id sh_tmu_id_table[] = {
-	{ "sh-tmu", SH_TMU },
-	{ "sh-tmu-sh3", SH_TMU_SH3 },
+	{ .name = "sh-tmu", .driver_data = SH_TMU },
+	{ .name = "sh-tmu-sh3", .driver_data = SH_TMU_SH3 },
 	{ }
 };
 MODULE_DEVICE_TABLE(platform, sh_tmu_id_table);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.