[alsa-devel] [PATCHv2 2/3] ASoC: Move widgets from DAPM context to snd_soc_card

Jarkko Nikula jhnikula at gmail.com
Fri Nov 12 15:25:54 CET 2010


On Fri, 12 Nov 2010 15:57:56 +0200
Jarkko Nikula <jhnikula at gmail.com> wrote:

> On Fri, 12 Nov 2010 13:18:41 +0000
> Mark Brown <broonie at opensource.wolfsonmicro.com> wrote:
> 
> > >  struct snd_soc_dapm_context {
> > > -	struct list_head widgets;
> > > +	int n_widgets; /* number of widgets in this context */
> > 
> > I'm not sure why we need to count the number of widgets here; 
> > 
> True, this should go the next patch actually.
> 
Not true, it is actually need here. We cannot detect widgetless codecs
by testing list_empty(&card->widgets) after moving widgets from dapm
to card so we must keep count of widgets for each DAPM context (device).

-	if (list_empty(&dapm->widgets)) {
+	if (!dapm->n_widgets) {


-- 
Jarkko


More information about the Alsa-devel mailing list