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: 5880731 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EF5F89F269 for ; Wed, 25 Feb 2015 15:02:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2D55020263 for ; Wed, 25 Feb 2015 15:02:21 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4A3BE2025B for ; Wed, 25 Feb 2015 15:02:20 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YQdQa-0006hB-GO; Wed, 25 Feb 2015 14:59:08 +0000 Received: from mail-pa0-f49.google.com ([209.85.220.49]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YQdNS-0004Sr-3I for linux-arm-kernel@lists.infradead.org; Wed, 25 Feb 2015 14:55:54 +0000 Received: by paceu11 with SMTP id eu11so5732713pac.10 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=ltqLRexUKAkjoz4Qt+udVNk4sQ1hVRIBJzDzmZhv6DwlmYV98SHBzEaA+Z6nsUFSaP Y9LwLa4tcn+MYkyhns33egsftKffSJjyH+Iv/sIbS7Cha2KxCIgaqUo9Pyp8QeWeFUYR +S/dWcUuFc7cTaGsNDndjXAy0lV9boiP4sbteOznXUY1oirns2alaIfpFevkzgjCF/T9 aF8ypmX5wybFgzYTtwRifd1tY649NFJkj0tmmN0I4Ff+v5kT/HK6KYkHHCbDjzN47ivV Sou8SbQeY0CD+w/w0v/FahPRPNAIGYrSMN2WLHB28KQijJNopbYDFnU3nvryzqJmQcOl xE8g== X-Gm-Message-State: ALoCoQmDTft/PUxIkNIgW8sEvbdl7z8CxnzLtY81PO+CKszRcrqK7bMeiy7qecfes/7ubtFpanvo 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150225_065554_226136_7D7CD562 X-CRM114-Status: GOOD ( 13.26 ) X-Spam-Score: -0.7 (/) Cc: linux-pwm@vger.kernel.org, alsa-devel@alsa-project.org, Russell King , linux-serial@vger.kernel.org, Greg Kroah-Hartman , Mark Brown , Stephen Boyd , dri-devel@lists.freedesktop.org, Thierry Reding , kernel@pengutronix.de, Shawn Guo , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;