Skip to contentSkip to conversation

ASoC: dapm: Fix changes to DECLARE_ADAU17X1_DSP_MUX_CTRL

PATCH In review Charles Keepax 2 participants 2 messages Mar 6, 2025

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

PATCH 1/1 ASoC: dapm: Fix changes to DECLARE_ADAU17X1_DSP_MUX_CTRL

The changes to DECLARE_ADAU17X1_DSP_MUX_CTRL did avoid the issue with a compiler not liking all the macro indirection. However it introduced a new issue with respect to the mux not being declared static:

sound/soc/codecs/adau17x1.c:275:8: sparse: sparse: symbol 'adau17x1_dac_mux' was not declared. Should it be static? sound/soc/codecs/adau17x1.c:278:8: sparse: sparse: symbol 'adau17x1_capture_mux' was not declared. Should it be static?

Fix this up by going back to the inline declaration of the soc_enum, but just call SOC_ENUM_EXT directly rather than indirecting through SOC_DAPM_ENUM_EXT.

Fixes c951b20766f0 ("ASoC: dapm: Use ASoC control macros where possible")
---
 sound/soc/codecs/adau17x1.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
sound/soc/codecs/adau17x1.c +4 -6
index 2ebb5c90bdd9..0b6b0d2115eb 100644
@@ -254,13 +254,11 @@ static int adau17x1_dsp_mux_enum_get(struct snd_kcontrol *kcontrol,
 }
 
 #define DECLARE_ADAU17X1_DSP_MUX_CTRL(_name, _label, _stream, _text) \
-	const struct soc_enum _name##_enum = \
-			SOC_ENUM_SINGLE(SND_SOC_NOPM, _stream, \
-					ARRAY_SIZE(_text), _text); \
 	const struct snd_kcontrol_new _name = \
-		SOC_DAPM_ENUM_EXT(_label, _name##_enum, \
-				  adau17x1_dsp_mux_enum_get, \
-				  adau17x1_dsp_mux_enum_put)
+		SOC_ENUM_EXT(_label, (const struct soc_enum)\
+			SOC_ENUM_SINGLE(SND_SOC_NOPM, _stream, \
+				ARRAY_SIZE(_text), _text), \
+			adau17x1_dsp_mux_enum_get, adau17x1_dsp_mux_enum_put)
 
 static const char * const adau17x1_dac_mux_text[] = {
 	"DSP",
Signature · 1 line
2.39.5
maintainer
#1 lore raw
Quoted 10 lines · Charles Keepax

The changes to DECLARE_ADAU17X1_DSP_MUX_CTRL did avoid the issue with a compiler not liking all the macro indirection. However it introduced a new issue with respect to the mux not being declared static:

sound/soc/codecs/adau17x1.c:275:8: sparse: sparse: symbol 'adau17x1_dac_mux' was not declared. Should it be static? sound/soc/codecs/adau17x1.c:278:8: sparse: sparse: symbol 'adau17x1_capture_mux' was not declared. Should it be static?

[...]

Applied to

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

Thanks!

[1/1] ASoC: dapm: Fix changes to DECLARE_ADAU17X1_DSP_MUX_CTRL

      commit: 269b844239149a9bbaba66518db99ebb06554a15

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