Skip to content

Commit

Permalink
ASoC: dapm: Only mark pin widgets as dirty if we actually change state
Browse files Browse the repository at this point in the history
Small optimisation for noop state updates.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
  • Loading branch information
Mark Brown committed Feb 17, 2012
1 parent 5567d8c commit 1a8b2d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1a8b2d9

Please sign in to comment.