From: Mark Brown Subject: [PATCH] ASoC: dapm: Only mark pin widgets as dirty if we actually change state Date: Thu, 16 Feb 2012 11:51:02 -0800 Message-ID: <1329421862-29645-1-git-send-email-broonie@opensource.wolfsonmicro.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from opensource.wolfsonmicro.com (opensource.wolfsonmicro.com [80.75.67.52]) by alsa0.perex.cz (Postfix) with ESMTP id 87371103F97 for ; Thu, 16 Feb 2012 20:51:07 +0100 (CET) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Liam Girdwood Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com, Mark Brown List-Id: alsa-devel@alsa-project.org Small optimisation for noop state updates. Signed-off-by: Mark Brown --- sound/soc/soc-dapm.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 2844879..a2a9c11 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -1915,10 +1915,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; } -- 1.7.9.rc1