From patchwork Wed Feb 25 14:53:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 45077 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f197.google.com (mail-we0-f197.google.com [74.125.82.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 37CD120502 for ; Wed, 25 Feb 2015 14:55:57 +0000 (UTC) Received: by wesk11 with SMTP id k11sf3270454wes.3 for ; Wed, 25 Feb 2015 06:55:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=pjyU2OWdl2AhT5S0brH+H0sLkoT8GzpQGJx+qPvc2ac=; b=VRrzgK7iI8K+6fBlWA3l2Sg/g4vpPqwuV3jSFjhojQ1hghHN17GglAY+wM8LJgbsvA veAkJ3wym7okdDfPhwYthlXP7gI+OtJZeZiBXK5nP5oK/FLoS3k6eWoWicjmGluFakJ+ MlvAbvY4xPoAO+XKKp7QmAiK7624YrceKz09fPimMDu1EX5H5FKYbZO/A8kMP4qOXVx2 SnMsvETgFlaoI+Ar1S8Xwbp/n2lszv13d1IV7XkdubolmAYqhRXMw1Y6G3TH+7De3P50 tL2++pw0BzFLNeNCcrRQBIaAZVXdzAsETvx3C5/e9+jYCEmeUL1t8wBJueM6x1hWokE2 d5IQ== X-Gm-Message-State: ALoCoQnQh8Mp4afs5d8OSte91IosbFtbE0z75hNcQpw9VWzRf9N3T6vSAPTqa7S98ZUbqcL83Z0H X-Received: by 10.194.142.174 with SMTP id rx14mr551549wjb.4.1424876156565; Wed, 25 Feb 2015 06:55:56 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.84 with SMTP id be20ls647402lab.89.gmail; Wed, 25 Feb 2015 06:55:56 -0800 (PST) X-Received: by 10.152.8.33 with SMTP id o1mr3258157laa.56.1424876156408; Wed, 25 Feb 2015 06:55:56 -0800 (PST) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id od4si28743115lbb.27.2015.02.25.06.55.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Feb 2015 06:55:56 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by labgd6 with SMTP id gd6so4383617lab.8 for ; Wed, 25 Feb 2015 06:55:56 -0800 (PST) X-Received: by 10.152.21.100 with SMTP id u4mr3042986lae.41.1424876156276; Wed, 25 Feb 2015 06:55:56 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp2668933lbj; Wed, 25 Feb 2015 06:55:55 -0800 (PST) X-Received: by 10.68.117.133 with SMTP id ke5mr6118373pbb.162.1424876154402; Wed, 25 Feb 2015 06:55:54 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xt17si24191169pac.212.2015.02.25.06.55.53 for ; Wed, 25 Feb 2015 06:55:54 -0800 (PST) Received-SPF: none (google.com: linux-serial-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752583AbbBYOzx (ORCPT ); Wed, 25 Feb 2015 09:55:53 -0500 Received: from mail-pd0-f175.google.com ([209.85.192.175]:42965 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752557AbbBYOzw (ORCPT ); Wed, 25 Feb 2015 09:55:52 -0500 Received: by pdbfp1 with SMTP id fp1so5357654pdb.9 for ; Wed, 25 Feb 2015 06:55:52 -0800 (PST) X-Received: by 10.70.34.177 with SMTP id a17mr5860646pdj.123.1424876152129; Wed, 25 Feb 2015 06:55:52 -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.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Feb 2015 06:55:51 -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 8/8] ASoC: kirkwood: fix struct clk pointer comparing Date: Wed, 25 Feb 2015 22:53:38 +0800 Message-Id: <1424876018-17852-9-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-serial-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-serial@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: shawn.guo@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- sound/soc/kirkwood/kirkwood-i2s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c index def7d8260c4e..d19483081f9b 100644 --- a/sound/soc/kirkwood/kirkwood-i2s.c +++ b/sound/soc/kirkwood/kirkwood-i2s.c @@ -579,7 +579,7 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev) if (PTR_ERR(priv->extclk) == -EPROBE_DEFER) return -EPROBE_DEFER; } else { - if (priv->extclk == priv->clk) { + if (clk_is_match(priv->extclk, priv->clk)) { devm_clk_put(&pdev->dev, priv->extclk); priv->extclk = ERR_PTR(-EINVAL); } else {