Re: [PATCH] ASoC: dapm: Do not traverse widget hooks to snd-soc-dummy

From: Pan, Harry
Date: Thu Mar 17 2016 - 06:39:10 EST


On Thu, 2016-03-17 at 09:54 +0000, Mark Brown wrote:
> On Wed, Mar 16, 2016 at 07:17:51PM +0800, Harry Pan wrote:
>
> > Conflicts:
> > sound/soc/soc-dapm.c
>
> Don't include noise like this in upstream submissions.
>
I learned, thanks.
> > + if (!strcmp(cmpnt->name, "snd-soc-dummy"))
> > + return 0;
> > +
>
> This doesn't make much sense and is going to be very fragile. We
> should either make the dummy component look like other components or
> make the code cope with them as they stand, that way we don't have
> random undocumented special cases scattered through the code. Probably
> it's better to make the dummy component look like others.

I do agree, basically.

Allow me to explain more detail that I saw during debug; since the
commit 6e78108bda78 (ASoC: core: Don't probe the component which is
dummy), an exception has been made that dummy component won't be probed,
thus the 'card' passed into soc_probe_component() would not be assigned
to this component. In the other hand, the component struct is initially
created in snd_soc_register_platform() by kzalloc() of platform struct,
its 'card' pointer is remaining an NULL pointer even the widget node
being read.

Perhaps another option is to refine soc_probe_component(), which I have
not dive in.

Sincerely,
Harry