Skip to contentSkip to conversation

ASoC: Use named initializers for platform_device_id arrays

PATCH In review Uwe Kleine-König (The Capable Hub) 8 participants 20 messages Jul 20 – Jul 30

Subsystems (14)
lore
Share & tools
lore
#0 lore raw

v2 cover ASoC: Use named initializers for platform_device_id arrays

Hello,

the objective of this series is still to prepare making struct platform_device_id::driver_data an anonymous union. See
https://lore.kernel.org/all/[email protected]/
for the details about that.

If you consider the last patch mostly churn, just drop it.

v1 of this series can be found at
https://lore.kernel.org/linux-sound/[email protected].

Changes since then:

- Rebase to current next
- Some grammar improvements in the commit log for patch #1
- Split the changes to sound/soc/amd/acp in separate changes.
- The 2nd patch used to be "ASoC: renesas: fsi: Simplify driver_data handling" which removed fsi_id_table[0].driver_data, but with commit 38d3273075d6 ("ASoC: renesas: fsi: remove platform data style support") that needed to change.
- The last patch now touches a few more files. (I didn't check if these are new offenders or if I failed to catch them in v1.) I didn't add Cezary Rojewski's ack because of that.

If splitting off the amd/acp changes was requested because they go in via a separate tree: That's possible, in fact each file is touched only once, so the patches can be reordered freely and applied via different trees if needed.

Best regards
Uwe

Uwe Kleine-König (The Capable Hub) (6):
ASoC: codecs: mt6357: Drop unused assignment of platform_device_id
driver data
ASoC: renesas: fsi: Drop platform probing metadata
ASoC: amd: acp: Use named initializers for platform_device_id arrays
ASoC: amd: acp: Unify code style for platform_device_id array
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/au1x/db1200.c                 |  2 +-
 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/avs/boards/probe.c      |  2 +-
 sound/soc/intel/avs/boards/rt274.c      |  2 +-
 sound/soc/intel/avs/boards/rt286.c      |  2 +-
 sound/soc/intel/avs/boards/rt298.c      |  2 +-
 sound/soc/intel/avs/boards/rt5514.c     |  2 +-
 sound/soc/intel/avs/boards/rt5640.c     |  2 +-
 sound/soc/intel/avs/boards/rt5663.c     |  2 +-
 sound/soc/intel/avs/boards/rt5682.c     |  2 +-
 sound/soc/intel/avs/boards/ssm4567.c    |  2 +-
 sound/soc/intel/boards/sof_sdw.c        |  4 ++--
 sound/soc/renesas/fsi.c                 |  4 ++--
 sound/soc/samsung/i2s.c                 |  2 +-
 33 files changed, 61 insertions(+), 87 deletions(-)

base-commit: 0718283ab28bc3907e10b61a6b4be6fefa1cbb2f

Signature · 1 line
2.55.0.11.g153666a7d9bb
#1 lore raw

PATCH v2 1/6 ASoC: codecs: mt6357: Drop unused assignment of platform_device_id driver data

The driver explicitly sets the .driver_data member of struct platform_device_id to zero without relying on that value. Drop this unused assignment.

While touching this array unify spacing, use a named initializer for .name and drop a trailing comma after the list terminator.

---
 sound/soc/codecs/mt6357.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/mt6357.c +2 -2
index 674cf7df9df4..3b07087e1cab 100644
@@ -1834,8 +1834,8 @@ static int mt6357_platform_driver_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id mt6357_platform_ids[] = {
-	{"mt6357-sound", 0},
-	{ /* sentinel */ },
+	{ .name = "mt6357-sound" },
+	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(platform, mt6357_platform_ids);
 
Signature · 1 line
2.55.0.11.g153666a7d9bb
#2 lore raw

PATCH v2 2/6 ASoC: renesas: fsi: Drop platform probing metadata

In reply to Uwe Kleine-König (The Capable Hub)

Since commit 38d3273075d6 ("ASoC: renesas: fsi: remove platform data style support") probing using the traditional platform bus matching isn't supported any more.

Drop the platform_device_id entries that should have been removed in the above commit. Note that keeping the empty array results in the driver not matching on "fsi-pcm-audio" (i.e. the driver name).

While touching that array, use a single space and no trailing comma for the list terminator, which is the most used style for this.

---
I was unsure about keeping the array. Also dropping MODULE_DEVICE_TABLE() if keeping it might be worth a thought.

---
 sound/soc/renesas/fsi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/renesas/fsi.c +2 -2
index 6be6587e1095..23b7e63596d3 100644
@@ -1979,8 +1979,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 },
-	{},
+	/* an array with no valid entry prevents matching on driver name */
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, fsi_id_table);
 
Signature · 1 line
2.55.0.11.g153666a7d9bb
#4 lore raw

PATCH v2 3/6 ASoC: amd: acp: Use named initializers for platform_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)

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.

---
 sound/soc/amd/acp/acp-sdw-legacy-mach.c | 4 ++--
 sound/soc/amd/acp/acp-sdw-sof-mach.c    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
sound/soc/amd/acp/acp-sdw-legacy-mach.c +2 -2
index 9726a9d33ec6..637dd2deebfa 100644
@@ -580,8 +580,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);
 
sound/soc/amd/acp/acp-sdw-sof-mach.c +2 -2
index 963ce6fd4012..8db889d824f6 100644
@@ -438,8 +438,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);
 
Signature · 1 line
2.55.0.11.g153666a7d9bb
#6 lore raw

PATCH v2 4/6 ASoC: amd: acp: Unify code style for platform_device_id array

In reply to Uwe Kleine-König (The Capable Hub)

- Add a trailing comma for initializers unless the closing brace is on the same line and for the list terminator;
- Use a single space in the list terminator;

---
 sound/soc/amd/acp/acp-sof-mach.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
sound/soc/amd/acp/acp-sof-mach.c +7 -7
index 36ecef7013b9..8874151e159a 100644
@@ -128,31 +128,31 @@ static int acp_sof_probe(struct platform_device *pdev)
 static const struct platform_device_id board_ids[] = {
 	{
 		.name = "rt5682-rt1019",
-		.driver_data = (kernel_ulong_t)&sof_rt5682_rt1019_data
+		.driver_data = (kernel_ulong_t)&sof_rt5682_rt1019_data,
 	},
 	{
 		.name = "rt5682-max",
-		.driver_data = (kernel_ulong_t)&sof_rt5682_max_data
+		.driver_data = (kernel_ulong_t)&sof_rt5682_max_data,
 	},
 	{
 		.name = "rt5682s-max",
-		.driver_data = (kernel_ulong_t)&sof_rt5682s_max_data
+		.driver_data = (kernel_ulong_t)&sof_rt5682s_max_data,
 	},
 	{
 		.name = "rt5682s-rt1019",
-		.driver_data = (kernel_ulong_t)&sof_rt5682s_rt1019_data
+		.driver_data = (kernel_ulong_t)&sof_rt5682s_rt1019_data,
 	},
 	{
 		.name = "nau8825-max",
-		.driver_data = (kernel_ulong_t)&sof_nau8825_data
+		.driver_data = (kernel_ulong_t)&sof_nau8825_data,
 	},
 	{
 		.name = "rt5682s-hs-rt1019",
-		.driver_data = (kernel_ulong_t)&sof_rt5682s_hs_rt1019_data
+		.driver_data = (kernel_ulong_t)&sof_rt5682s_hs_rt1019_data,
 	},
 	{
 		.name = "nau8821-max",
-		.driver_data = (kernel_ulong_t)&sof_nau8821_max98388_data
+		.driver_data = (kernel_ulong_t)&sof_nau8821_max98388_data,
 	},
 	{ }
 };
Signature · 1 line
2.55.0.11.g153666a7d9bb
#10 lore raw

PATCH v2 5/6 ASoC: Use named initializers for platform_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)

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.

---
 sound/soc/codecs/cs40l50-codec.c | 4 ++--
 sound/soc/codecs/cs42l43.c       | 4 ++--
 sound/soc/intel/boards/sof_sdw.c | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
sound/soc/codecs/cs40l50-codec.c +2 -2
index aa629ef53db4..676367163067 100644
@@ -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);
 
sound/soc/codecs/cs42l43.c +2 -2
index 47308cd870fb..1b817e1a6ea5 100644
@@ -2935,8 +2935,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);
 
sound/soc/intel/boards/sof_sdw.c +2 -2
index 1013e07052a3..346a7b59d8e3 100644
@@ -1542,8 +1542,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);
 
Signature · 1 line
2.55.0.11.g153666a7d9bb
#13 lore raw

PATCH v2 6/6 ASOC: Unify code style for platform_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)

- Add a trailing comma for initializers unless the closing brace is on the same line and for the list terminator;
- Use a single space in the list terminator;
- Use compact one-line style for small entries;
- s/\t=/ =/ were the tab is only one char wide anyhow;

---
 sound/soc/au1x/db1200.c                |  2 +-
 sound/soc/codecs/adau7118-hw.c         |  2 +-
 sound/soc/codecs/bt-sco.c              | 10 +++-------
 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/avs/boards/probe.c     |  2 +-
 sound/soc/intel/avs/boards/rt274.c     |  2 +-
 sound/soc/intel/avs/boards/rt286.c     |  2 +-
 sound/soc/intel/avs/boards/rt298.c     |  2 +-
 sound/soc/intel/avs/boards/rt5514.c    |  2 +-
 sound/soc/intel/avs/boards/rt5640.c    |  2 +-
 sound/soc/intel/avs/boards/rt5663.c    |  2 +-
 sound/soc/intel/avs/boards/rt5682.c    |  2 +-
 sound/soc/intel/avs/boards/ssm4567.c   |  2 +-
 sound/soc/samsung/i2s.c                |  2 +-
 25 files changed, 40 insertions(+), 66 deletions(-)
sound/soc/au1x/db1200.c +1 -1
index 81abe2e18402..78346cd7959c 100644
@@ -42,7 +42,7 @@ static const struct platform_device_id db1200_pids[] = {
 		.name		= "db1550-i2s",
 		.driver_data	= 5,
 	},
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, db1200_pids);
 
sound/soc/codecs/adau7118-hw.c +1 -1
index 92b226b8b4bb..4342eb7dd9e5 100644
@@ -22,7 +22,7 @@ static const struct of_device_id adau7118_of_match[] = {
 MODULE_DEVICE_TABLE(of, adau7118_of_match);
 
 static const struct platform_device_id adau7118_id[] = {
-	{ .name	= "adau7118" },
+	{ .name = "adau7118" },
 	{ }
 };
 MODULE_DEVICE_TABLE(platform, adau7118_id);
sound/soc/codecs/bt-sco.c +3 -7
index c0bf45b76cb8..b085885e3f18 100644
@@ -85,13 +85,9 @@ static int bt_sco_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id bt_sco_driver_ids[] = {
-	{
-		.name		= "dfbmcs320",
-	},
-	{
-		.name		= "bt-sco",
-	},
-	{},
+	{ .name = "dfbmcs320" },
+	{ .name = "bt-sco" },
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, bt_sco_driver_ids);
 
sound/soc/codecs/wcd934x.c +2 -4
index bc41a1466c70..a9e6f2923099 100644
@@ -5899,10 +5899,8 @@ static int wcd934x_codec_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id wcd934x_driver_id[] = {
-	{
-		.name = "wcd934x-codec",
-	},
-	{},
+	{ .name = "wcd934x-codec" },
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, wcd934x_driver_id);
 
sound/soc/fsl/imx-pcm-rpmsg.c +3 -3
index ee741f3d79bd..7086fb7fc1eb 100644
@@ -810,9 +810,9 @@ static const struct dev_pm_ops imx_rpmsg_pcm_pm_ops = {
 };
 
 static const struct platform_device_id imx_rpmsg_pcm_id_table[] = {
-	{ .name	= "rpmsg-audio-channel" },
-	{ .name	= "rpmsg-micfil-channel" },
-	{ },
+	{ .name = "rpmsg-audio-channel" },
+	{ .name = "rpmsg-micfil-channel" },
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, imx_rpmsg_pcm_id_table);
 
sound/soc/intel/avs/boards/da7219.c +2 -4
index 2b17abcbd2bc..163d9982d797 100644
@@ -259,10 +259,8 @@ static int avs_da7219_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id avs_da7219_driver_ids[] = {
-	{
-		.name = "avs_da7219",
-	},
-	{},
+	{ .name = "avs_da7219" },
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_da7219_driver_ids);
 
sound/soc/intel/avs/boards/dmic.c +2 -4
index bf6f580a5164..8d36bc7ddf16 100644
@@ -104,10 +104,8 @@ static int avs_dmic_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id avs_dmic_driver_ids[] = {
-	{
-		.name = "avs_dmic",
-	},
-	{},
+	{ .name = "avs_dmic" },
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_dmic_driver_ids);
 
sound/soc/intel/avs/boards/es8336.c +2 -4
index 301cfb3cf15b..36c13db3a272 100644
@@ -309,10 +309,8 @@ static int avs_es8336_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id avs_es8336_driver_ids[] = {
-	{
-		.name = "avs_es8336",
-	},
-	{},
+	{ .name = "avs_es8336" },
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_es8336_driver_ids);
 
sound/soc/intel/avs/boards/hdaudio.c +2 -4
index aec769e2396c..03cfd91202d3 100644
@@ -231,10 +231,8 @@ static int avs_hdaudio_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id avs_hdaudio_driver_ids[] = {
-	{
-		.name = "avs_hdaudio",
-	},
-	{},
+	{ .name = "avs_hdaudio" },
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_hdaudio_driver_ids);
 
sound/soc/intel/avs/boards/i2s_test.c +2 -4
index 9a6b89ffdf14..787d781ba1d9 100644
@@ -107,10 +107,8 @@ static int avs_i2s_test_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id avs_i2s_test_driver_ids[] = {
-	{
-		.name = "avs_i2s_test",
-	},
-	{},
+	{ .name = "avs_i2s_test" },
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_i2s_test_driver_ids);
 
sound/soc/intel/avs/boards/max98357a.c +2 -4
index e9a87804f918..389a50923d3b 100644
@@ -136,10 +136,8 @@ static int avs_max98357a_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id avs_max98357a_driver_ids[] = {
-	{
-		.name = "avs_max98357a",
-	},
-	{},
+	{ .name = "avs_max98357a" },
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_max98357a_driver_ids);
 
sound/soc/intel/avs/boards/max98373.c +2 -4
index 8b45b643ca29..b8231f71d3d6 100644
@@ -191,10 +191,8 @@ static int avs_max98373_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id avs_max98373_driver_ids[] = {
-	{
-		.name = "avs_max98373",
-	},
-	{},
+	{ .name = "avs_max98373" },
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_max98373_driver_ids);
 
sound/soc/intel/avs/boards/max98927.c +2 -4
index db073125fa4d..d657e7da1cc0 100644
@@ -188,10 +188,8 @@ static int avs_max98927_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id avs_max98927_driver_ids[] = {
-	{
-		.name = "avs_max98927",
-	},
-	{},
+	{ .name = "avs_max98927" },
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_max98927_driver_ids);
 
sound/soc/intel/avs/boards/nau8825.c +2 -4
index d44edacbfc9a..d7ea08bb27cd 100644
@@ -293,10 +293,8 @@ static int avs_nau8825_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id avs_nau8825_driver_ids[] = {
-	{
-		.name = "avs_nau8825",
-	},
-	{},
+	{ .name = "avs_nau8825" },
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_nau8825_driver_ids);
 
sound/soc/intel/avs/boards/pcm3168a.c +2 -4
index b5bebadbbcb2..9d415fd0499a 100644
@@ -132,10 +132,8 @@ static int avs_pcm3168a_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id avs_pcm3168a_driver_ids[] = {
-	{
-		.name = "avs_pcm3168a",
-	},
-	{},
+	{ .name = "avs_pcm3168a" },
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_pcm3168a_driver_ids);
 
sound/soc/intel/avs/boards/probe.c +1 -1
index 73884f8a535c..4053d14289b9 100644
@@ -64,7 +64,7 @@ static const struct platform_device_id avs_probe_mb_driver_ids[] = {
 	{
 		.name = "avs_probe_mb",
 	},
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_probe_mb_driver_ids);
 
sound/soc/intel/avs/boards/rt274.c +1 -1
index a689f4c80867..289f1230851f 100644
@@ -261,7 +261,7 @@ static const struct platform_device_id avs_rt274_driver_ids[] = {
 	{
 		.name = "avs_rt274",
 	},
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_rt274_driver_ids);
 
sound/soc/intel/avs/boards/rt286.c +1 -1
index 4c9ac545555a..9364d60cfcc7 100644
@@ -231,7 +231,7 @@ static const struct platform_device_id avs_rt286_driver_ids[] = {
 	{
 		.name = "avs_rt286",
 	},
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_rt286_driver_ids);
 
sound/soc/intel/avs/boards/rt298.c +1 -1
index 2d7a7748d577..5d3b3cdc9564 100644
@@ -250,7 +250,7 @@ static const struct platform_device_id avs_rt298_driver_ids[] = {
 	{
 		.name = "avs_rt298",
 	},
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_rt298_driver_ids);
 
sound/soc/intel/avs/boards/rt5514.c +1 -1
index 22139eaad83a..e448bc9fa5ad 100644
@@ -178,7 +178,7 @@ static const struct platform_device_id avs_rt5514_driver_ids[] = {
 	{
 		.name = "avs_rt5514",
 	},
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_rt5514_driver_ids);
 
sound/soc/intel/avs/boards/rt5640.c +1 -1
index 2990d32f2301..c4e33d71e82f 100644
@@ -252,7 +252,7 @@ static const struct platform_device_id avs_rt5640_driver_ids[] = {
 	{
 		.name = "avs_rt5640",
 	},
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_rt5640_driver_ids);
 
sound/soc/intel/avs/boards/rt5663.c +1 -1
index 68fea325376a..aadbd3f2a1b2 100644
@@ -249,7 +249,7 @@ static const struct platform_device_id avs_rt5663_driver_ids[] = {
 	{
 		.name = "avs_rt5663",
 	},
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_rt5663_driver_ids);
 
sound/soc/intel/avs/boards/rt5682.c +1 -1
index 81863728da1d..d33699cca595 100644
@@ -325,7 +325,7 @@ static const struct platform_device_id avs_rt5682_driver_ids[] = {
 	{
 		.name = "avs_rt5682",
 	},
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_rt5682_driver_ids);
 
sound/soc/intel/avs/boards/ssm4567.c +1 -1
index ae0e6e27a8b8..d7c9bff37556 100644
@@ -180,7 +180,7 @@ static const struct platform_device_id avs_ssm4567_driver_ids[] = {
 	{
 		.name = "avs_ssm4567",
 	},
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, avs_ssm4567_driver_ids);
 
sound/soc/samsung/i2s.c +1 -1
index 56d11741dabd..81d5dd36a246 100644
@@ -1675,7 +1675,7 @@ static const struct platform_device_id samsung_i2s_driver_ids[] = {
 		.name           = "samsung-i2s",
 		.driver_data	= (kernel_ulong_t)&i2sv3_dai_type,
 	},
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, samsung_i2s_driver_ids);
 
Signature · 1 line
2.55.0.11.g153666a7d9bb
#14 lore raw

Re: [PATCH v2 6/6] ASOC: Unify code style for platform_device_id arrays

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] The commit introduces a style inconsistency by missing several small platform_device_id arrays…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The commit introduces a style inconsistency by missing several small platform_device_id arrays during its mechanical refactoring, despite the commit message claiming to use a 'compact one-line style for small entries'. --

--- Patch [6]: [PATCH v2 6/6] ASOC: Unify code style for platform_device_id arrays --- commit 03434ab8a73c8818fd87d755c26c0b8e9e4f5807
Author: Uwe Kleine-König (The Capable Hub) <[email protected]>

ASOC: Unify code style for platform_device_id arrays

This commit unifies the code style of platform_device_id arrays across various ASoC drivers. It updates list terminators to use a single space and attempts to use a compact one-line style for small entries.

[ ... ]

sound/soc/intel/avs/boards/probe.c static const struct platform_device_id avs_probe_mb_driver_ids[] = { · line 67

Quoted 10 lines
sound/soc/intel/avs/boards/probe.c +1 -1
index 73884f8a535ca..4053d14289b95 100644
@@ -64,7 +64,7 @@ static const struct platform_device_id avs_probe_mb_driver_ids[] = {
 	{
 		.name = "avs_probe_mb",
 	},
-	{},
+	{ }

[Severity: Low]
This isn't a bug, but should this entry also use the compact one-line style mentioned in the commit message? It seems like this array missed the single line styling update that was applied to files like da7219.c.

Quoted 2 lines
sound/soc/intel/avs/boards/probe.c +0 -0
 };
 MODULE_DEVICE_TABLE(platform, avs_probe_mb_driver_ids);

[ ... ]

sound/soc/intel/avs/boards/rt274.c static const struct platform_device_id avs_rt274_driver_ids[] = { · line 264

Quoted 10 lines
sound/soc/intel/avs/boards/rt274.c +1 -1
index a689f4c80867b..289f1230851f4 100644
@@ -261,7 +261,7 @@ static const struct platform_device_id avs_rt274_driver_ids[] = {
 	{
 		.name = "avs_rt274",
 	},
-	{},
+	{ }

[Severity: Low]
This isn't a bug, but similar to the probe.c file above, should this entry be compacted to a single line? There are several other files in this directory (rt286.c, rt298.c, rt5514.c, etc.) that also seem to have missed the compact one-line style update.

Quoted 3 lines
sound/soc/intel/avs/boards/rt274.c +0 -0
 };
 MODULE_DEVICE_TABLE(platform, avs_rt274_driver_ids);
 
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
maintainer
#7 lore raw

Re: [PATCH v2 4/6] ASoC: amd: acp: Unify code style for platform_device_id array

In reply to Uwe Kleine-König (The Capable Hub)
Quoted 5 lines · Uwe Kleine-König (The Capable Hub)

- Add a trailing comma for initializers unless the closing brace is on

    the same line and for the list terminator;

- Use a single space in the list terminator;

Perhaps I should have been more clear in my previous response [1] - I expected the sound/soc/intel/avs changes be separated and then ACK tag can be freely added _only_ to those (avs-driver) changes. I do not ACK non-Intel patches.

[1]: https://lore.kernel.org/linux-sound/[email protected]/

Quoted 1 line
Reviewed-by on v2 5/6
#11 lore raw
In reply to Uwe Kleine-König (The Capable Hub)
Quoted 8 lines · Uwe Kleine-König (The Capable Hub)

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.

---

Thanks,
Charles

#8 lore raw

Re: [PATCH v2 4/6] ASoC: amd: acp: Unify code style for platform_device_id array

In reply to Cezary Rojewski
Quoted 11 lines · Cezary Rojewski
Quoted 5 lines · Uwe Kleine-König (The Capable Hub)

- Add a trailing comma for initializers unless the closing brace is on

    the same line and for the list terminator;

- Use a single space in the list terminator;

Perhaps I should have been more clear in my previous response [1] - I expected the sound/soc/intel/avs changes be separated and then ACK tag can be freely added _only_ to those (avs-driver) changes. I do not ACK non-Intel patches.

Ah, I didn't revisit that after collecting the review tags using b4. One way to express that in a way that b4 handles is to write:

Acked-yb: Cezary Rojewski <[email protected]> # for sound/soc/intel/avs

(typo made deliberately to make b4 skip this example).

Will adapt for v3 (if it comes to that).

Best regards
Uwe

#3 lore raw

Re: [PATCH v2 2/6] ASoC: renesas: fsi: Drop platform probing metadata

In reply to Uwe Kleine-König (The Capable Hub)

Hi Uwe

Thank you for the patch

Quoted 4 lines

Since commit 38d3273075d6 ("ASoC: renesas: fsi: remove platform data style support") probing using the traditional platform bus matching isn't supported any more.

Quoted 8 lines

Drop the platform_device_id entries that should have been removed in the above commit. Note that keeping the empty array results in the driver not matching on "fsi-pcm-audio" (i.e. the driver name).

While touching that array, use a single space and no trailing comma for the list terminator, which is the most used style for this.

Yes, indeed. id_table is no longer needed

Quoted 2 lines

I was unsure about keeping the array. Also dropping MODULE_DEVICE_TABLE() if keeping it might be worth a thought.

Yeah.
Because it doesn't support platform data style, id_table itself is no longer needed. Our other driver which support DT style only doesn't have id_table.

Thank you for your help !!

Best regards
---
Kuninori Morimoto

maintainer Reviewed-by on v2 3/6
#5 lore raw

Re: [PATCH v2 3/6] ASoC: amd: acp: Use named initializers for platform_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)
Quoted 9 lines · Uwe Kleine-König (The Capable Hub)

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

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.

Quoted 38 lines
---
 sound/soc/amd/acp/acp-sdw-legacy-mach.c | 4 ++--
 sound/soc/amd/acp/acp-sdw-sof-mach.c    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
sound/soc/amd/acp/acp-sdw-legacy-mach.c +2 -2
index 9726a9d33ec6..637dd2deebfa 100644
@@ -580,8 +580,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);
 
sound/soc/amd/acp/acp-sdw-sof-mach.c +2 -3
index 963ce6fd4012..8db889d824f6 100644
@@ -438,8 +438,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);
 
--

2.55.0.11.g153666a7d9bb

maintainer Reviewed-by on v2 4/6
#9 lore raw

Re: [PATCH v2 4/6] ASoC: amd: acp: Unify code style for platform_device_id array

In reply to Uwe Kleine-König (The Capable Hub)
Quoted 8 lines · Uwe Kleine-König (The Capable Hub)

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

- Add a trailing comma for initializers unless the closing brace is on the same line and for the list terminator;
- Use a single space in the list terminator;

Quoted 50 lines
---
 sound/soc/amd/acp/acp-sof-mach.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
sound/soc/amd/acp/acp-sof-mach.c +7 -8
index 36ecef7013b9..8874151e159a 100644
@@ -128,31 +128,31 @@ static int acp_sof_probe(struct platform_device *pdev)
 static const struct platform_device_id board_ids[] = {
        {
                .name = "rt5682-rt1019",
-               .driver_data = (kernel_ulong_t)&sof_rt5682_rt1019_data
+               .driver_data = (kernel_ulong_t)&sof_rt5682_rt1019_data,
        },
        {
                .name = "rt5682-max",
-               .driver_data = (kernel_ulong_t)&sof_rt5682_max_data
+               .driver_data = (kernel_ulong_t)&sof_rt5682_max_data,
        },
        {
                .name = "rt5682s-max",
-               .driver_data = (kernel_ulong_t)&sof_rt5682s_max_data
+               .driver_data = (kernel_ulong_t)&sof_rt5682s_max_data,
        },
        {
                .name = "rt5682s-rt1019",
-               .driver_data = (kernel_ulong_t)&sof_rt5682s_rt1019_data
+               .driver_data = (kernel_ulong_t)&sof_rt5682s_rt1019_data,
        },
        {
                .name = "nau8825-max",
-               .driver_data = (kernel_ulong_t)&sof_nau8825_data
+               .driver_data = (kernel_ulong_t)&sof_nau8825_data,
        },
        {
                .name = "rt5682s-hs-rt1019",
-               .driver_data = (kernel_ulong_t)&sof_rt5682s_hs_rt1019_data
+               .driver_data = (kernel_ulong_t)&sof_rt5682s_hs_rt1019_data,
        },
        {
                .name = "nau8821-max",
-               .driver_data = (kernel_ulong_t)&sof_nau8821_max98388_data
+               .driver_data = (kernel_ulong_t)&sof_nau8821_max98388_data,
        },
        { }
 };
--

2.55.0.11.g153666a7d9bb

maintainer
#15 lore raw

Re: [PATCH v2 6/6] ASOC: Unify code style for platform_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)
Quoted 17 lines · Uwe Kleine-König (The Capable Hub)
  sound/soc/au1x/db1200.c                |  2 +-
  sound/soc/codecs/adau7118-hw.c         |  2 +-
  sound/soc/codecs/bt-sco.c              | 10 +++-------
  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/avs/boards/probe.c     |  2 +-
  sound/soc/intel/avs/boards/rt274.c     |  2 +-
Quoted 8 lines
  sound/soc/intel/avs/boards/rt286.c     |  2 +-
  sound/soc/intel/avs/boards/rt298.c     |  2 +-
  sound/soc/intel/avs/boards/rt5514.c    |  2 +-
  sound/soc/intel/avs/boards/rt5640.c    |  2 +-
  sound/soc/intel/avs/boards/rt5663.c    |  2 +-
  sound/soc/intel/avs/boards/rt5682.c    |  2 +-
  sound/soc/intel/avs/boards/ssm4567.c   |  2 +-
  sound/soc/samsung/i2s.c                |  2 +-

This change is outstanding when compared to patches 1-4 which follow the
per-driver approach. I'd expect one driver per scope e.g.: Intel's
avs split away from the rest.

Nitpick: s/ASOC/ASoC/

If it comes to v3, I'd appreciate having a separate patch for the avs-driver components with the following title applied:

ASoC: Intel: avs:

#16 lore raw

Re: [PATCH v2 6/6] ASOC: Unify code style for platform_device_id arrays

Hello Cezary,

Quoted 28 lines · Cezary Rojewski
Quoted 17 lines · Uwe Kleine-König (The Capable Hub)
  sound/soc/au1x/db1200.c                |  2 +-
  sound/soc/codecs/adau7118-hw.c         |  2 +-
  sound/soc/codecs/bt-sco.c              | 10 +++-------
  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/avs/boards/probe.c     |  2 +-
  sound/soc/intel/avs/boards/rt274.c     |  2 +-
Quoted 8 lines
  sound/soc/intel/avs/boards/rt286.c     |  2 +-
  sound/soc/intel/avs/boards/rt298.c     |  2 +-
  sound/soc/intel/avs/boards/rt5514.c    |  2 +-
  sound/soc/intel/avs/boards/rt5640.c    |  2 +-
  sound/soc/intel/avs/boards/rt5663.c    |  2 +-
  sound/soc/intel/avs/boards/rt5682.c    |  2 +-
  sound/soc/intel/avs/boards/ssm4567.c   |  2 +-
  sound/soc/samsung/i2s.c                |  2 +-
Quoted 3 lines

This change is outstanding when compared to patches 1-4 which follow the per-driver approach. I'd expect one driver per scope e.g.: Intel's avs split away from the rest.

Well, patches 1 and 2 primarily follow the one patch per type of change approach that happen to only affect one driver each. In the v1 thread I was asked to split out split out the amd/acp bits which resulted in patches 3 and 4. (And just now I notice you also replied and asked to split out intel/avs, too, which I missed. Sorry!)

Conceptually I think one commit per driver is the right approach[1] but most maintainers/reviewers seem to favour one commit adapting one thing for all drivers in a subsystem. And in my experience no matter how you make it, you get a reply to change.

Will split out intel/avs for v3 and maybe hit the sweet spot then.

Quoted 1 line

Nitpick: s/ASOC/ASoC/

Fixed in my tree, so will be correct in v3.

Best regards
Uwe

[1] My reason for that is the "one atomic change per patch" philosophy that allows to document who reviewed/acked what in a fine-grained way and allows selective reverting and backporting as needed. The downside is that the number of patches explodes, but git is able to handle that just fine in my experience. "commit count" is missing in https://markcarrigan.net/2026/06/18/the-museum-of-meaningless-metrics/

maintainer
#17 lore raw

Re: [PATCH v2 6/6] ASOC: Unify code style for platform_device_id arrays

Quoted 41 lines · Uwe Kleine-König (The Capable Hub)

Hello Cezary,

Quoted 28 lines · Cezary Rojewski
Quoted 17 lines · Uwe Kleine-König (The Capable Hub)
   sound/soc/au1x/db1200.c                |  2 +-
   sound/soc/codecs/adau7118-hw.c         |  2 +-
   sound/soc/codecs/bt-sco.c              | 10 +++-------
   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/avs/boards/probe.c     |  2 +-
   sound/soc/intel/avs/boards/rt274.c     |  2 +-
Quoted 8 lines
   sound/soc/intel/avs/boards/rt286.c     |  2 +-
   sound/soc/intel/avs/boards/rt298.c     |  2 +-
   sound/soc/intel/avs/boards/rt5514.c    |  2 +-
   sound/soc/intel/avs/boards/rt5640.c    |  2 +-
   sound/soc/intel/avs/boards/rt5663.c    |  2 +-
   sound/soc/intel/avs/boards/rt5682.c    |  2 +-
   sound/soc/intel/avs/boards/ssm4567.c   |  2 +-
   sound/soc/samsung/i2s.c                |  2 +-
Quoted 3 lines

This change is outstanding when compared to patches 1-4 which follow the per-driver approach. I'd expect one driver per scope e.g.: Intel's avs split away from the rest.

Well, patches 1 and 2 primarily follow the one patch per type of change approach that happen to only affect one driver each. In the v1 thread I was asked to split out split out the amd/acp bits which resulted in patches 3 and 4. (And just now I notice you also replied and asked to split out intel/avs, too, which I missed. Sorry!)

Quoted 4 lines

Conceptually I think one commit per driver is the right approach[1] but most maintainers/reviewers seem to favour one commit adapting one thing for all drivers in a subsystem. And in my experience no matter how you make it, you get a reply to change.

Couldn't agree more with the last one. Happens to us all :)

Quoted 1 line

Will split out intel/avs for v3 and maybe hit the sweet spot then.

Thank you.

maintainer
#18 lore raw
In reply to Uwe Kleine-König (The Capable Hub)
Quoted 10 lines · Uwe Kleine-König (The Capable Hub)

ASoC: Use named initializers for platform_device_id arrays

Hello,

the objective of this series is still to prepare making struct platform_device_id::driver_data an anonymous union. See
https://lore.kernel.org/all/[email protected]/
for the details about that.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.3

Thanks!

[1/6] ASoC: codecs: mt6357: Drop unused assignment of platform_device_id driver data

      https://git.kernel.org/broonie/sound/c/c7a6909de856
[2/6] ASoC: renesas: fsi: Drop platform probing metadata
      https://git.kernel.org/broonie/sound/c/0ca8f65516a9
[3/6] ASoC: amd: acp: Use named initializers for platform_device_id arrays
      https://git.kernel.org/broonie/sound/c/2b26d06fd3d8
[4/6] ASoC: amd: acp: Unify code style for platform_device_id array
      https://git.kernel.org/broonie/sound/c/4bed1074db1e
[5/6] ASoC: Use named initializers for platform_device_id arrays
      https://git.kernel.org/broonie/sound/c/232725a0e386
[6/6] ASOC: Unify code style for platform_device_id arrays
      https://git.kernel.org/broonie/sound/c/e4dc03df1f71

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

maintainer
#19 lore raw
Quoted 19 lines · Mark Brown
Quoted 10 lines · Uwe Kleine-König (The Capable Hub)

ASoC: Use named initializers for platform_device_id arrays

Hello,

the objective of this series is still to prepare making struct platform_device_id::driver_data an anonymous union. See
https://lore.kernel.org/all/[email protected]/
for the details about that.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.3

Thanks!

[1/6] ASoC: codecs: mt6357: Drop unused assignment of platform_device_id driver data

Quoted 11 lines
       https://git.kernel.org/broonie/sound/c/c7a6909de856
[2/6] ASoC: renesas: fsi: Drop platform probing metadata
       https://git.kernel.org/broonie/sound/c/0ca8f65516a9
[3/6] ASoC: amd: acp: Use named initializers for platform_device_id arrays
       https://git.kernel.org/broonie/sound/c/2b26d06fd3d8
[4/6] ASoC: amd: acp: Unify code style for platform_device_id array
       https://git.kernel.org/broonie/sound/c/4bed1074db1e
[5/6] ASoC: Use named initializers for platform_device_id arrays
       https://git.kernel.org/broonie/sound/c/232725a0e386
[6/6] ASOC: Unify code style for platform_device_id arrays
       https://git.kernel.org/broonie/sound/c/e4dc03df1f71

I'd at least expect my Acked-by: tag replaced with Reviewed-by: for the AMD's patch 4/6. Perhaps it does not matter in a long run but I feel better pointing this out (it has been pointed during the review).

Kind regards,
Czarek

maintainer Reviewed-by on v2 5/6
#12 lore raw
In reply to Uwe Kleine-König (The Capable Hub)
Quoted 7 lines · Uwe Kleine-König (The Capable Hub)

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.

Quoted 51 lines
---
 sound/soc/codecs/cs40l50-codec.c | 4 ++--
 sound/soc/codecs/cs42l43.c       | 4 ++--
 sound/soc/intel/boards/sof_sdw.c | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
sound/soc/codecs/cs40l50-codec.c +2 -2
index aa629ef53db4..676367163067 100644
@@ -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);
 
sound/soc/codecs/cs42l43.c +2 -2
index 47308cd870fb..1b817e1a6ea5 100644
@@ -2935,8 +2935,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);
 
sound/soc/intel/boards/sof_sdw.c +2 -2
index 1013e07052a3..346a7b59d8e3 100644
@@ -1542,8 +1542,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);
 
Signature · 1 line
Péter