Skip to content

Commit

Permalink
ASoC: Fix dapm_seq_compare() for multi-component
Browse files Browse the repository at this point in the history
Ensure that we keep all widget powerups in DAPM sequence by making
the CODEC the last thing we compare on rather than the first thing.
Also fix the fact that we're currently comparing the widget pointers
rather than the CODEC pointers when we do the substraction so we
won't get stable results.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Nov 15, 2010
1 parent ccb3b84 commit bcbb243
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -683,12 +683,12 @@ static int dapm_seq_compare(struct snd_soc_dapm_widget *a,
struct snd_soc_dapm_widget *b,
int sort[])
{
if (a->codec != b->codec)
return (unsigned long)a - (unsigned long)b;
if (sort[a->id] != sort[b->id])
return sort[a->id] - sort[b->id];
if (a->reg != b->reg)
return a->reg - b->reg;
if (a->codec != b->codec)
return (unsigned long)a->codec - (unsigned long)b->codec;

return 0;
}
Expand Down

0 comments on commit bcbb243

Please sign in to comment.