Browse Source

ASoC: dapm: Only mark pin widgets as dirty if we actually change state

Small optimisation for noop state updates.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Mark Brown 13 years ago
parent
commit
1a8b2d9d5b
1 changed files with 3 additions and 1 deletions
  1. 3 1
      sound/soc/soc-dapm.c

+ 3 - 1
sound/soc/soc-dapm.c

@@ -1927,10 +1927,12 @@ static int snd_soc_dapm_set_pin(struct snd_soc_dapm_context *dapm,
 		return -EINVAL;
 	}
 
+	if (w->connected != status)
+		dapm_mark_dirty(w, "pin configuration");
+
 	w->connected = status;
 	if (status == 0)
 		w->force = 0;
-	dapm_mark_dirty(w, "pin configuration");
 
 	return 0;
 }