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

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

Date: Mon Aug 17 2026 - 04:44:04 EST


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) <u.kleine-koenig@xxxxxxxxxxxx>
AuthorDate: Wed, 17 Jun 2026 11:24:11 +02:00
Committer: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
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) <u.kleine-koenig@xxxxxxxxxxxx>
Signed-off-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
Link: https://patch.msgid.link/6a6951b86f0e9a2ab4a378ab63edf7a487f1d693.1781687723.git.u.kleine-koenig@xxxxxxxxxxxx
---
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);