Skip to content

ASoC: Use named initializers for platform_device_id arrays

Uwe Kleine-König (The Capable Hub) imx linux-arm-kernel linux-arm-msm linux-mediatek linux-renesas-soc linux-sound linuxppc-dev lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4ASoC: codecs: mt6357: Drop unused assignment of platform_device_id driver datasound/soc/codecs/mt6357.c+2 -20 replies
2/4ASoC: renesas: fsi: Simplify driver_data handlingsound/soc/renesas/fsi.c+3 -52 replies
3/4ASoC: Use named initializers for platform_device_id arrayssound/soc/amd/acp/acp-sdw-legacy-mach.c sound/soc/amd/acp/acp-sdw-sof-mach.c sound/soc/codecs/cs40l50-codec.c +2 more+10 -101 reply
4/4ASOC: Unify code style for platform_device_id arrayssound/soc/amd/acp/acp-sof-mach.c sound/soc/codecs/adau7118-hw.c sound/soc/codecs/bt-sco.c +12 more+36 -621 reply

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by.

PatchCezary RojewskiKuninori Morimoto
1/4
2/4R-b
3/4
4/4A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH v1 0/4] ASoC: Use named initializers for platform_device_id arrays

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

Signature · 1 line
2.47.3