* [PATCH v1] clk: Use named initializers for platform_device_id arrays
@ 2026-05-28 10:29 Uwe Kleine-König (The Capable Hub)
2026-05-28 10:41 ` Tudor Ambarus
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-05-28 10:29 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd
Cc: Matti Vaittinen, Brian Masney, Chanwoo Choi, Krzysztof Kozlowski,
André Draszik, Tudor Ambarus, Sylwester Nawrocki,
Alim Akhtar, linux-clk, linux-kernel, linux-samsung-soc
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>
---
Hello,
see e.g.
https://lore.kernel.org/all/cover.1779893336.git.u.kleine-koenig@baylibre.com/
for details about my quest to modify platform_device_id.
Best regards
Uwe
drivers/clk/clk-bd718x7.c | 12 ++++++------
drivers/clk/clk-max77686.c | 8 ++++----
drivers/clk/clk-s2mps11.c | 12 ++++++------
drivers/clk/samsung/clk-acpm.c | 4 ++--
4 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/drivers/clk/clk-bd718x7.c b/drivers/clk/clk-bd718x7.c
index 1cae974e6d1d..8ddb50c67757 100644
--- a/drivers/clk/clk-bd718x7.c
+++ b/drivers/clk/clk-bd718x7.c
@@ -147,12 +147,12 @@ static int bd71837_clk_probe(struct platform_device *pdev)
}
static const struct platform_device_id bd718x7_clk_id[] = {
- { "bd71837-clk", ROHM_CHIP_TYPE_BD71837 },
- { "bd71847-clk", ROHM_CHIP_TYPE_BD71847 },
- { "bd71828-clk", ROHM_CHIP_TYPE_BD71828 },
- { "bd71815-clk", ROHM_CHIP_TYPE_BD71815 },
- { "bd72720-clk", ROHM_CHIP_TYPE_BD72720 },
- { },
+ { .name = "bd71837-clk", .driver_data = ROHM_CHIP_TYPE_BD71837 },
+ { .name = "bd71847-clk", .driver_data = ROHM_CHIP_TYPE_BD71847 },
+ { .name = "bd71828-clk", .driver_data = ROHM_CHIP_TYPE_BD71828 },
+ { .name = "bd71815-clk", .driver_data = ROHM_CHIP_TYPE_BD71815 },
+ { .name = "bd72720-clk", .driver_data = ROHM_CHIP_TYPE_BD72720 },
+ { }
};
MODULE_DEVICE_TABLE(platform, bd718x7_clk_id);
diff --git a/drivers/clk/clk-max77686.c b/drivers/clk/clk-max77686.c
index 9149ce4f702d..e6fde914c5ef 100644
--- a/drivers/clk/clk-max77686.c
+++ b/drivers/clk/clk-max77686.c
@@ -264,10 +264,10 @@ static int max77686_clk_probe(struct platform_device *pdev)
}
static const struct platform_device_id max77686_clk_id[] = {
- { "max77686-clk", .driver_data = CHIP_MAX77686, },
- { "max77802-clk", .driver_data = CHIP_MAX77802, },
- { "max77620-clock", .driver_data = CHIP_MAX77620, },
- {},
+ { .name = "max77686-clk", .driver_data = CHIP_MAX77686 },
+ { .name = "max77802-clk", .driver_data = CHIP_MAX77802 },
+ { .name = "max77620-clock", .driver_data = CHIP_MAX77620 },
+ { }
};
MODULE_DEVICE_TABLE(platform, max77686_clk_id);
diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
index ff7ce12a5da6..fa5ac8f673f6 100644
--- a/drivers/clk/clk-s2mps11.c
+++ b/drivers/clk/clk-s2mps11.c
@@ -225,12 +225,12 @@ static void s2mps11_clk_remove(struct platform_device *pdev)
}
static const struct platform_device_id s2mps11_clk_id[] = {
- { "s2mpg10-clk", S2MPG10},
- { "s2mps11-clk", S2MPS11X},
- { "s2mps13-clk", S2MPS13X},
- { "s2mps14-clk", S2MPS14X},
- { "s5m8767-clk", S5M8767X},
- { },
+ { .name = "s2mpg10-clk", .driver_data = S2MPG10 },
+ { .name = "s2mps11-clk", .driver_data = S2MPS11X },
+ { .name = "s2mps13-clk", .driver_data = S2MPS13X },
+ { .name = "s2mps14-clk", .driver_data = S2MPS14X },
+ { .name = "s5m8767-clk", .driver_data = S5M8767X },
+ { }
};
MODULE_DEVICE_TABLE(platform, s2mps11_clk_id);
diff --git a/drivers/clk/samsung/clk-acpm.c b/drivers/clk/samsung/clk-acpm.c
index 953ca8d5720a..25cfa953ccac 100644
--- a/drivers/clk/samsung/clk-acpm.c
+++ b/drivers/clk/samsung/clk-acpm.c
@@ -166,8 +166,8 @@ static int acpm_clk_probe(struct platform_device *pdev)
}
static const struct platform_device_id acpm_clk_id[] = {
- { "gs101-acpm-clk" },
- {}
+ { .name = "gs101-acpm-clk" },
+ { }
};
MODULE_DEVICE_TABLE(platform, acpm_clk_id);
base-commit: e7d700e14934e68f86338c5610cf2ae76798b663
--
2.47.3
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH v1] clk: Use named initializers for platform_device_id arrays
2026-05-28 10:29 [PATCH v1] clk: Use named initializers for platform_device_id arrays Uwe Kleine-König (The Capable Hub)
@ 2026-05-28 10:41 ` Tudor Ambarus
2026-05-28 10:53 ` Peter Griffin
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Tudor Ambarus @ 2026-05-28 10:41 UTC (permalink / raw)
To: Uwe Kleine-König (The Capable Hub), Michael Turquette,
Stephen Boyd
Cc: Matti Vaittinen, Brian Masney, Chanwoo Choi, Krzysztof Kozlowski,
André Draszik, Sylwester Nawrocki, Alim Akhtar, linux-clk,
linux-kernel, linux-samsung-soc
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v1] clk: Use named initializers for platform_device_id arrays
2026-05-28 10:29 [PATCH v1] clk: Use named initializers for platform_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-05-28 10:41 ` Tudor Ambarus
@ 2026-05-28 10:53 ` Peter Griffin
2026-05-28 15:01 ` Brian Masney
2026-05-29 7:27 ` Matti Vaittinen
3 siblings, 0 replies; 5+ messages in thread
From: Peter Griffin @ 2026-05-28 10:53 UTC (permalink / raw)
To: Uwe Kleine-König (The Capable Hub)
Cc: Michael Turquette, Stephen Boyd, Matti Vaittinen, Brian Masney,
Chanwoo Choi, Krzysztof Kozlowski, André Draszik,
Tudor Ambarus, Sylwester Nawrocki, Alim Akhtar, linux-clk,
linux-kernel, linux-samsung-soc
On Thu, 28 May 2026 at 11:34, Uwe Kleine-König (The Capable Hub)
<u.kleine-koenig@baylibre.com> wrote:
>
> 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: Peter Griffin <peter.griffin@linaro.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1] clk: Use named initializers for platform_device_id arrays
2026-05-28 10:29 [PATCH v1] clk: Use named initializers for platform_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-05-28 10:41 ` Tudor Ambarus
2026-05-28 10:53 ` Peter Griffin
@ 2026-05-28 15:01 ` Brian Masney
2026-05-29 7:27 ` Matti Vaittinen
3 siblings, 0 replies; 5+ messages in thread
From: Brian Masney @ 2026-05-28 15:01 UTC (permalink / raw)
To: Uwe Kleine-König (The Capable Hub)
Cc: Michael Turquette, Stephen Boyd, Matti Vaittinen, Chanwoo Choi,
Krzysztof Kozlowski, André Draszik, Tudor Ambarus,
Sylwester Nawrocki, Alim Akhtar, linux-clk, linux-kernel,
linux-samsung-soc
On Thu, May 28, 2026 at 12:29:38PM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> 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: Brian Masney <bmasney@redhat.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1] clk: Use named initializers for platform_device_id arrays
2026-05-28 10:29 [PATCH v1] clk: Use named initializers for platform_device_id arrays Uwe Kleine-König (The Capable Hub)
` (2 preceding siblings ...)
2026-05-28 15:01 ` Brian Masney
@ 2026-05-29 7:27 ` Matti Vaittinen
3 siblings, 0 replies; 5+ messages in thread
From: Matti Vaittinen @ 2026-05-29 7:27 UTC (permalink / raw)
To: Uwe Kleine-König (The Capable Hub), Michael Turquette,
Stephen Boyd
Cc: Brian Masney, Chanwoo Choi, Krzysztof Kozlowski,
André Draszik, Tudor Ambarus, Sylwester Nawrocki,
Alim Akhtar, linux-clk, linux-kernel, linux-samsung-soc
On 28/05/2026 13:29, Uwe Kleine-König (The Capable Hub) wrote:
> 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>
--
---
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland
~~ When things go utterly wrong vim users can always type :help! ~~
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-05-29 7:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-28 10:29 [PATCH v1] clk: Use named initializers for platform_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-05-28 10:41 ` Tudor Ambarus
2026-05-28 10:53 ` Peter Griffin
2026-05-28 15:01 ` Brian Masney
2026-05-29 7:27 ` Matti Vaittinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox