From patchwork Wed Feb 25 14:53:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 443424 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A447814007D for ; Thu, 26 Feb 2015 01:55:33 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752835AbbBYOzd (ORCPT ); Wed, 25 Feb 2015 09:55:33 -0500 Received: from mail-pa0-f42.google.com ([209.85.220.42]:34946 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752516AbbBYOzc (ORCPT ); Wed, 25 Feb 2015 09:55:32 -0500 Received: by padfa1 with SMTP id fa1so5830672pad.2 for ; Wed, 25 Feb 2015 06:55:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IkgngykRMKNYvC6VAgqjCairHuaH1OvWeXOvwnDpzbc=; b=KKYnL1n5gFSfVsvyhwRtNddy2ShUBC6reh/SpsfLvFeJ9ASXqGHV0qZfgpohekvrT0 9xfTyeVpuSTTTK6be7VSTXeyvEYPAB9bQ/ZLi6fA5UXxIaRu9XsJupI4t96KCPTo2YU4 nWfaqi7T1YGXheeFxvwaGMd7XAgnvHX6+CBvG6tK66v90BnEOFN+AMfs71wktzeKac8i fz/cLnilEOKxpim60SJYoxKKrxyMt94CQA2mo1lPE30OZiKOr8ZIaekR65158lUUAv6h tw3zXjiUUNK6u6mMoBYP03fSQ2Vna8fCpze7hCXqXskddZx59ZcZAc8uyC5geGmzvduh yCOQ== X-Gm-Message-State: ALoCoQkodQjPClSUGjaABkUiRvhR1Bv9/iLetrPMYs+TpmAInoLplNX/gZJInF8YOw8ZnsZ+SFrf X-Received: by 10.70.133.168 with SMTP id pd8mr6121888pdb.122.1424876132359; Wed, 25 Feb 2015 06:55:32 -0800 (PST) Received: from localhost.localdomain (119.81.172.112-static.reverse.softlayer.com. [119.81.172.112]) by mx.google.com with ESMTPSA id nd5sm41502517pbc.64.2015.02.25.06.55.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Feb 2015 06:55:31 -0800 (PST) From: Shawn Guo To: Mike Turquette Cc: linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, Russell King , Stephen Boyd , Thierry Reding , Greg Kroah-Hartman , Mark Brown , linux-pwm@vger.kernel.org, alsa-devel@alsa-project.org, dri-devel@lists.freedesktop.org, linux-serial@vger.kernel.org, Shawn Guo Subject: [PATCH 6/8] ASoC: fsl_esai: fix struct clk pointer comparing Date: Wed, 25 Feb 2015 22:53:36 +0800 Message-Id: <1424876018-17852-7-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1424876018-17852-1-git-send-email-shawn.guo@linaro.org> References: <1424876018-17852-1-git-send-email-shawn.guo@linaro.org> Sender: linux-pwm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pwm@vger.kernel.org Since commit 035a61c314eb ("clk: Make clk API return per-user struct clk instances"), clk API users can no longer check if two struct clk pointers are pointing to the same hardware clock, i.e. struct clk_hw, by simply comparing two pointers. That's because with the per-user clk change, a brand new struct clk is created whenever clients try to look up the clock by calling clk_get() or sister functions like clk_get_sys() and of_clk_get(). This changes the original behavior where the struct clk is only created for once when clock driver registers the clock to CCF in the first place. The net change here is before commit 035a61c314eb the struct clk pointer is unique for given hardware clock, while after the commit the pointers returned by clk lookup calls become different for the same hardware clock. That said, the struct clk pointer comparing in the code doesn't work any more. Call helper function clk_is_match() instead to fix the problem. Signed-off-by: Shawn Guo Acked-by: Mark Brown --- sound/soc/fsl/fsl_esai.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c index 5c7597191e3f..6e00e51b98c2 100644 --- a/sound/soc/fsl/fsl_esai.c +++ b/sound/soc/fsl/fsl_esai.c @@ -269,7 +269,7 @@ static int fsl_esai_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id, } /* Only EXTAL source can be output directly without using PSR and PM */ - if (ratio == 1 && clksrc == esai_priv->extalclk) { + if (ratio == 1 && clk_is_match(clksrc, esai_priv->extalclk)) { /* Bypass all the dividers if not being needed */ ecr |= tx ? ESAI_ECR_ETO : ESAI_ECR_ERO; goto out;