[PATCH v1 3/4] ASoC: Use named initializers for platform_device_id arrays

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

Date: Thu May 28 2026 - 05:20:17 EST


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@xxxxxxxxxxxx>
---
sound/soc/amd/acp/acp-sdw-legacy-mach.c | 4 ++--
sound/soc/amd/acp/acp-sdw-sof-mach.c | 4 ++--
sound/soc/codecs/cs40l50-codec.c | 4 ++--
sound/soc/codecs/cs42l43.c | 4 ++--
sound/soc/intel/boards/sof_sdw.c | 4 ++--
5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/sound/soc/amd/acp/acp-sdw-legacy-mach.c b/sound/soc/amd/acp/acp-sdw-legacy-mach.c
index 09b475c83c49..c3a0e0c4e996 100644
--- a/sound/soc/amd/acp/acp-sdw-legacy-mach.c
+++ b/sound/soc/amd/acp/acp-sdw-legacy-mach.c
@@ -579,8 +579,8 @@ static void mc_remove(struct platform_device *pdev)
}

static const struct platform_device_id mc_id_table[] = {
- { "amd_sdw", },
- {}
+ { .name = "amd_sdw" },
+ { }
};
MODULE_DEVICE_TABLE(platform, mc_id_table);

diff --git a/sound/soc/amd/acp/acp-sdw-sof-mach.c b/sound/soc/amd/acp/acp-sdw-sof-mach.c
index a0fd8a6f9970..578f24329c04 100644
--- a/sound/soc/amd/acp/acp-sdw-sof-mach.c
+++ b/sound/soc/amd/acp/acp-sdw-sof-mach.c
@@ -437,8 +437,8 @@ static void mc_remove(struct platform_device *pdev)
}

static const struct platform_device_id mc_id_table[] = {
- { "amd_sof_sdw", },
- {}
+ { .name = "amd_sof_sdw" },
+ { }
};
MODULE_DEVICE_TABLE(platform, mc_id_table);

diff --git a/sound/soc/codecs/cs40l50-codec.c b/sound/soc/codecs/cs40l50-codec.c
index aa629ef53db4..676367163067 100644
--- a/sound/soc/codecs/cs40l50-codec.c
+++ b/sound/soc/codecs/cs40l50-codec.c
@@ -288,8 +288,8 @@ static int cs40l50_codec_driver_probe(struct platform_device *pdev)
}

static const struct platform_device_id cs40l50_id[] = {
- { "cs40l50-codec", },
- {}
+ { .name = "cs40l50-codec" },
+ { }
};
MODULE_DEVICE_TABLE(platform, cs40l50_id);

diff --git a/sound/soc/codecs/cs42l43.c b/sound/soc/codecs/cs42l43.c
index f0d6ff0b2976..08f94ce18e14 100644
--- a/sound/soc/codecs/cs42l43.c
+++ b/sound/soc/codecs/cs42l43.c
@@ -2942,8 +2942,8 @@ static const struct dev_pm_ops cs42l43_codec_pm_ops = {
};

static const struct platform_device_id cs42l43_codec_id_table[] = {
- { "cs42l43-codec", },
- {}
+ { .name = "cs42l43-codec" },
+ { }
};
MODULE_DEVICE_TABLE(platform, cs42l43_codec_id_table);

diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c
index d43daf9b025d..135c93ce4415 100644
--- a/sound/soc/intel/boards/sof_sdw.c
+++ b/sound/soc/intel/boards/sof_sdw.c
@@ -1539,8 +1539,8 @@ static void mc_remove(struct platform_device *pdev)
}

static const struct platform_device_id mc_id_table[] = {
- { "sof_sdw", },
- {}
+ { .name = "sof_sdw" },
+ { }
};
MODULE_DEVICE_TABLE(platform, mc_id_table);

--
2.47.3