summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown2010-11-12 16:14:55 +0100
committerMark Brown2010-11-15 14:19:32 +0100
commitbcbb243396b82b0369465e9a547b7d5278cd26ad (patch)
treec65d85931047068e4d1c0080b65f133e38ef1bdb
parentASoC: RX1950: Fix hw_params function (diff)
downloadkernel-qcow2-linux-bcbb243396b82b0369465e9a547b7d5278cd26ad.tar.gz
kernel-qcow2-linux-bcbb243396b82b0369465e9a547b7d5278cd26ad.tar.xz
kernel-qcow2-linux-bcbb243396b82b0369465e9a547b7d5278cd26ad.zip
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: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/soc-dapm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 7d85c6496afa..75ed6491222d 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -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;
}