Re: [PATCH 5/5] ASoC: soc.h: don't create dummy Component via COMP_DUMMY()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/7/2023 2:21 AM, Kuninori Morimoto wrote:

Hi Amadeusz

Thank you for your feedback

--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -938,7 +938,7 @@ snd_soc_link_to_platform(struct snd_soc_dai_link *link, int n) {
   #define COMP_PLATFORM(_name)		{ .name = _name }
   #define COMP_AUX(_name)			{ .name = _name }
   #define COMP_CODEC_CONF(_name)		{ .name = _name }
-#define COMP_DUMMY()			{ .name = "snd-soc-dummy", .dai_name = "snd-soc-dummy-dai", }
+#define COMP_DUMMY()			/* see snd_soc_fill_dummy_dai() */

Isn't it effectively making COMP_DUMMY same as COMP_EMPTY, or am I not
seeing something? I guess next step could be to just remove all
COMP_DUMMY and replace them with COMP_EMPTY to avoid two definitions
which are same thing?

It is a little bit macro magic

COMP_EMPTY()
	static struct snd_soc_dai_link_component name[]	= {{ }},
	                                                   ^^^
COMP_DUMMY()
	static struct snd_soc_dai_link_component name[]	= {   },
	                                                   ^^^
EMPTY case will be 1 element array, DUMMY case will be 0 element array.
So, EMPTY case has empty element, and is not a special/strange array.
But DUMMY case, it has pointer but 0 size array, very special/strange.
This patch making this special/strange array on purpose, and convert it
to asoc_dummy_dlc() on soc-core.c
Is this good answer for you ?


Yes, thanks!

+		if (dai_link->num_platforms == 0 && dai_link->platforms) {
+			dev_warn(card->dev, "platform don't need dummy Component/DAI\n");

I would just replace above print with code comment, no need to spam dmesg.

OK, will fix in v2


Thank you for your help !!

Best regards
---
Renesas Electronics
Ph.D. Kuninori Morimoto




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux