Commit bcbb2433 authored by Mark Brown's avatar Mark Brown

ASoC: Fix dapm_seq_compare() for multi-component

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: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent ccb3b84f
...@@ -683,12 +683,12 @@ static int dapm_seq_compare(struct snd_soc_dapm_widget *a, ...@@ -683,12 +683,12 @@ static int dapm_seq_compare(struct snd_soc_dapm_widget *a,
struct snd_soc_dapm_widget *b, struct snd_soc_dapm_widget *b,
int sort[]) int sort[])
{ {
if (a->codec != b->codec)
return (unsigned long)a - (unsigned long)b;
if (sort[a->id] != sort[b->id]) if (sort[a->id] != sort[b->id])
return sort[a->id] - sort[b->id]; return sort[a->id] - sort[b->id];
if (a->reg != b->reg) if (a->reg != b->reg)
return 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; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment