From patchwork Wed Feb 25 14:53:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 45070 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B3F4B20502 for ; Wed, 25 Feb 2015 14:55:03 +0000 (UTC) Received: by lbiw7 with SMTP id w7sf3327944lbi.0 for ; Wed, 25 Feb 2015 06:55:02 -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=WHitjjIBR5mTpsChJnapg9oIT8oot33o8af/mV9CzDM=; b=mT4IRSelBijA+MUWGvjcpFiDGopUJvmJBfcmPhkS839F3BFWjNPjZPU5aMeSHBTay9 niCAjBYm1hzr37RMoW5RPliMpUM2qB/pL9JL2NCFcPsJSQKo8MlS7v4nuAw7Zb58XH1u DfTNXbfMCnPuSQ5TS7JnvP8B5Yz3iMX0+1G8NpE4oOsE0PD05gqUUFuYVlloiZIiBklw xvTvlnOERadhpXUixo7gdM+TzWy+vHzF1nNHgGLuWPIRgp7RRZAwtR+3lEMCBryJAUta +xSr0injy3Z+hlrAANxZ1FCzT71VAuduB8hWjmCufizw/Gx+D5vOYM7jFMwvx/Vyr3v/ we3g== X-Gm-Message-State: ALoCoQnFdKFrBLvHEk2jeG9uKb+YI9n4u/0TSpJ+wyD5vwDsFJhuw1tm+ip2BB0P9K3tySCl7s4b X-Received: by 10.112.40.81 with SMTP id v17mr550005lbk.5.1424876102677; Wed, 25 Feb 2015 06:55:02 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.136 with SMTP id e8ls352344lam.91.gmail; Wed, 25 Feb 2015 06:55:02 -0800 (PST) X-Received: by 10.112.170.132 with SMTP id am4mr3048128lbc.89.1424876102526; Wed, 25 Feb 2015 06:55:02 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id b4si14164139lah.17.2015.02.25.06.55.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Feb 2015 06:55:02 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by lbvp9 with SMTP id p9so4405725lbv.0 for ; Wed, 25 Feb 2015 06:55:02 -0800 (PST) X-Received: by 10.112.167.36 with SMTP id zl4mr3292448lbb.32.1424876102426; Wed, 25 Feb 2015 06:55:02 -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 h5csp2668424lbj; Wed, 25 Feb 2015 06:55:01 -0800 (PST) X-Received: by 10.67.4.132 with SMTP id ce4mr5776619pad.133.1424876100689; Wed, 25 Feb 2015 06:55:00 -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.54.59 for ; Wed, 25 Feb 2015 06:55:00 -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 S1752641AbbBYOy6 (ORCPT ); Wed, 25 Feb 2015 09:54:58 -0500 Received: from mail-pd0-f176.google.com ([209.85.192.176]:35910 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752516AbbBYOy6 (ORCPT ); Wed, 25 Feb 2015 09:54:58 -0500 Received: by pdjp10 with SMTP id p10so5404474pdj.3 for ; Wed, 25 Feb 2015 06:54:57 -0800 (PST) X-Received: by 10.66.100.202 with SMTP id fa10mr6193992pab.36.1424876097649; Wed, 25 Feb 2015 06:54:57 -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.54.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Feb 2015 06:54:57 -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 2/8] ARM: imx: fix struct clk pointer comparing Date: Wed, 25 Feb 2015 22:53:32 +0800 Message-Id: <1424876018-17852-3-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.217.177 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 --- arch/arm/mach-imx/mach-imx6q.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index 4ad6e473cf83..9de3412af406 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -211,8 +211,9 @@ static void __init imx6q_1588_init(void) * set bit IOMUXC_GPR1[21]. Or the PTP clock must be from pad * (external OSC), and we need to clear the bit. */ - clksel = ptp_clk == enet_ref ? IMX6Q_GPR1_ENET_CLK_SEL_ANATOP : - IMX6Q_GPR1_ENET_CLK_SEL_PAD; + clksel = clk_is_match(ptp_clk, enet_ref) ? + IMX6Q_GPR1_ENET_CLK_SEL_ANATOP : + IMX6Q_GPR1_ENET_CLK_SEL_PAD; gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr"); if (!IS_ERR(gpr)) regmap_update_bits(gpr, IOMUXC_GPR1,