* [PATCH v1 0/4] ASoC: Use named initializers for platform_device_id arrays
@ 2026-05-28 9:05 Uwe Kleine-König (The Capable Hub)
2026-05-28 9:06 ` [PATCH v1 2/4] ASoC: renesas: fsi: Simplify driver_data handling Uwe Kleine-König (The Capable Hub)
0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-05-28 9:05 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown
Cc: Jaroslav Kysela, Takashi Iwai, Matthias Brugger,
AngeloGioacchino Del Regno, Charles Keepax, Kuninori Morimoto,
linux-sound, linux-kernel, linux-arm-kernel, linux-mediatek,
linux-renesas-soc, Vijendar Mukunda, Venkata Prasad Potturu,
James Ogletree, Fred Treven, Ben Bright, David Rhodes,
Richard Fitzgerald, Cezary Rojewski, Peter Ujfalusi, Bard Liao,
Kai Vehmanen, Pierre-Louis Bossart, Syed Saba Kareem,
Mario Limonciello (AMD), Krzysztof Kozlowski, Mark Pearson,
Hasun Park, Li Qiang, Kees Cook, Ranjani Sridharan, Mac Chiang,
Maciej Strozek, patches, Lars-Peter Clausen, Nuno Sá,
Srinivas Kandagatla, Shengjiu Wang, Xiubo Li, Fabio Estevam,
Nicolin Chen, Frank Li, Sascha Hauer, Pengutronix Kernel Team,
Guilherme G. Piccoli, Mario Limonciello, Cristian Ciocaltea,
Amadeusz Sławiński, linux-arm-msm, linuxppc-dev, imx
Hello,
this series targets to use named initializers for platform_device_id
arrays. In general these are better readable for humans and more robust
to changes in the respective struct definition.
This robustness is needed as I want to do
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -610,4 +610,7 @@ struct dmi_system_id {
struct platform_device_id {
char name[PLATFORM_NAME_SIZE];
- kernel_ulong_t driver_data;
+ union {
+ kernel_ulong_t driver_data;
+ const void *driver_data_ptr;
+ };
};
which allows dropping several casts and eases porting CHERI to mainline
linux. When adapting e.g. sound/soc/amd/acp/acp-legacy-mach.c to that
and make use of driver_data_ptr, the added const makes it obvious that
acp_asoc_probe() modifies the structs linked in the id_table resulting
in issues if more than one device is probed using the same platform id.
sound/soc/amd/acp/acp-sof-mach.c has the same issue.
If you consider the last patch mostly churn, just drop it.
Best regards
Uwe
Uwe Kleine-König (The Capable Hub) (4):
ASoC: codecs: mt6357: Drop unused assignment of platform_device_id
driver data
ASoC: renesas: fsi: Simplify driver_data handling
ASoC: Use named initializers for platform_device_id arrays
ASOC: Unify code style for platform_device_id arrays
sound/soc/amd/acp/acp-sdw-legacy-mach.c | 4 ++--
sound/soc/amd/acp/acp-sdw-sof-mach.c | 4 ++--
sound/soc/amd/acp/acp-sof-mach.c | 14 +++++++-------
sound/soc/codecs/adau7118-hw.c | 2 +-
sound/soc/codecs/bt-sco.c | 10 +++-------
sound/soc/codecs/cs40l50-codec.c | 4 ++--
sound/soc/codecs/cs42l43.c | 4 ++--
sound/soc/codecs/mt6357.c | 4 ++--
sound/soc/codecs/wcd934x.c | 6 ++----
sound/soc/fsl/imx-pcm-rpmsg.c | 6 +++---
sound/soc/intel/avs/boards/da7219.c | 6 ++----
sound/soc/intel/avs/boards/dmic.c | 6 ++----
sound/soc/intel/avs/boards/es8336.c | 6 ++----
sound/soc/intel/avs/boards/hdaudio.c | 6 ++----
sound/soc/intel/avs/boards/i2s_test.c | 6 ++----
sound/soc/intel/avs/boards/max98357a.c | 6 ++----
sound/soc/intel/avs/boards/max98373.c | 6 ++----
sound/soc/intel/avs/boards/max98927.c | 6 ++----
sound/soc/intel/avs/boards/nau8825.c | 6 ++----
sound/soc/intel/avs/boards/pcm3168a.c | 6 ++----
sound/soc/intel/boards/sof_sdw.c | 4 ++--
sound/soc/renesas/fsi.c | 8 +++-----
22 files changed, 51 insertions(+), 79 deletions(-)
base-commit: e7d700e14934e68f86338c5610cf2ae76798b663
--
2.47.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v1 2/4] ASoC: renesas: fsi: Simplify driver_data handling
2026-05-28 9:05 [PATCH v1 0/4] ASoC: Use named initializers for platform_device_id arrays Uwe Kleine-König (The Capable Hub)
@ 2026-05-28 9:06 ` Uwe Kleine-König (The Capable Hub)
2026-05-28 22:29 ` Kuninori Morimoto
2026-06-12 7:43 ` Uwe Kleine-König (The Capable Hub)
0 siblings, 2 replies; 4+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-05-28 9:06 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown
Cc: Kuninori Morimoto, Jaroslav Kysela, Takashi Iwai, linux-sound,
linux-renesas-soc, linux-kernel
Instead of hiding the fsi_core struct for the only supported (non-of)
device behind an abstraction for multi-device support, hardcode the used
pointer which gets rid of (open-coded) platform_get_device_id() and two
casts.
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
sound/soc/renesas/fsi.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/sound/soc/renesas/fsi.c b/sound/soc/renesas/fsi.c
index 8cbd7acc26f4..efd1447eacb9 100644
--- a/sound/soc/renesas/fsi.c
+++ b/sound/soc/renesas/fsi.c
@@ -1905,8 +1905,8 @@ static const struct of_device_id fsi_of_match[] = {
MODULE_DEVICE_TABLE(of, fsi_of_match);
static const struct platform_device_id fsi_id_table[] = {
- { "sh_fsi", (kernel_ulong_t)&fsi1_core },
- {},
+ { .name = "sh_fsi" },
+ { }
};
MODULE_DEVICE_TABLE(platform, fsi_id_table);
@@ -1929,9 +1929,7 @@ static int fsi_probe(struct platform_device *pdev)
fsi_of_parse("fsia", np, &info.port_a, &pdev->dev);
fsi_of_parse("fsib", np, &info.port_b, &pdev->dev);
} else {
- const struct platform_device_id *id_entry = pdev->id_entry;
- if (id_entry)
- core = (struct fsi_core *)id_entry->driver_data;
+ core = &fsi1_core;
if (pdev->dev.platform_data)
memcpy(&info, pdev->dev.platform_data, sizeof(info));
--
2.47.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v1 2/4] ASoC: renesas: fsi: Simplify driver_data handling
2026-05-28 9:06 ` [PATCH v1 2/4] ASoC: renesas: fsi: Simplify driver_data handling Uwe Kleine-König (The Capable Hub)
@ 2026-05-28 22:29 ` Kuninori Morimoto
2026-06-12 7:43 ` Uwe Kleine-König (The Capable Hub)
1 sibling, 0 replies; 4+ messages in thread
From: Kuninori Morimoto @ 2026-05-28 22:29 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
linux-sound, linux-renesas-soc, linux-kernel
Hi
> Instead of hiding the fsi_core struct for the only supported (non-of)
> device behind an abstraction for multi-device support, hardcode the used
> pointer which gets rid of (open-coded) platform_get_device_id() and two
> casts.
>
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
> ---
Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thank you for your help !!
Best regards
---
Kuninori Morimoto
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1 2/4] ASoC: renesas: fsi: Simplify driver_data handling
2026-05-28 9:06 ` [PATCH v1 2/4] ASoC: renesas: fsi: Simplify driver_data handling Uwe Kleine-König (The Capable Hub)
2026-05-28 22:29 ` Kuninori Morimoto
@ 2026-06-12 7:43 ` Uwe Kleine-König (The Capable Hub)
1 sibling, 0 replies; 4+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-06-12 7:43 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown
Cc: Kuninori Morimoto, Jaroslav Kysela, Takashi Iwai, linux-sound,
linux-renesas-soc, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1792 bytes --]
On Thu, May 28, 2026 at 11:06:01AM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> Instead of hiding the fsi_core struct for the only supported (non-of)
> device behind an abstraction for multi-device support, hardcode the used
> pointer which gets rid of (open-coded) platform_get_device_id() and two
> casts.
>
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
> ---
> sound/soc/renesas/fsi.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/sound/soc/renesas/fsi.c b/sound/soc/renesas/fsi.c
> index 8cbd7acc26f4..efd1447eacb9 100644
> --- a/sound/soc/renesas/fsi.c
> +++ b/sound/soc/renesas/fsi.c
> @@ -1905,8 +1905,8 @@ static const struct of_device_id fsi_of_match[] = {
> MODULE_DEVICE_TABLE(of, fsi_of_match);
>
> static const struct platform_device_id fsi_id_table[] = {
> - { "sh_fsi", (kernel_ulong_t)&fsi1_core },
> - {},
> + { .name = "sh_fsi" },
> + { }
> };
> MODULE_DEVICE_TABLE(platform, fsi_id_table);
>
> @@ -1929,9 +1929,7 @@ static int fsi_probe(struct platform_device *pdev)
> fsi_of_parse("fsia", np, &info.port_a, &pdev->dev);
> fsi_of_parse("fsib", np, &info.port_b, &pdev->dev);
> } else {
> - const struct platform_device_id *id_entry = pdev->id_entry;
> - if (id_entry)
> - core = (struct fsi_core *)id_entry->driver_data;
> + core = &fsi1_core;
>
> if (pdev->dev.platform_data)
> memcpy(&info, pdev->dev.platform_data, sizeof(info));
With commit 38d3273075d6 ("ASoC: renesas: fsi: remove platform data
style support") this patch doesn't apply any more. I will wait till
after the upcoming merge window and then respin this series. (But if you
take the other patches until then, I won't be angry :-)
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-06-12 7:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-28 9:05 [PATCH v1 0/4] ASoC: Use named initializers for platform_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-05-28 9:06 ` [PATCH v1 2/4] ASoC: renesas: fsi: Simplify driver_data handling Uwe Kleine-König (The Capable Hub)
2026-05-28 22:29 ` Kuninori Morimoto
2026-06-12 7:43 ` Uwe Kleine-König (The Capable Hub)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox