From patchwork Wed Feb 25 14:53:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 45071 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9310A20502 for ; Wed, 25 Feb 2015 14:55:12 +0000 (UTC) Received: by labge10 with SMTP id ge10sf3296661lab.3 for ; Wed, 25 Feb 2015 06:55:11 -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=MIyDKHToo5n3NjHzZAJLI8Qz0fB0/rX0wsb4VCoUVTY=; b=c2on0pYBXNHG14rcj1nHUJ0Ddvfv81ixTuPcHtMCcV+lgWAlCoDWg1DedkmSJ8UoAQ YAa+n/zKjay+qH7DE6xq28z9jdFHEuBBEyj+bB9Sp7G34CRKPuBes7nnzfWhd0ej6Zfu 6HQKN9elNJMsUem6S0zwHSj/oqh+TS26ACcZxsN/q3xtSv+lSImWY/mjJq0LEaUrs86R VW78f7yBYodvlUha2oeVqD7pLOoFC4Z2y6QFg2sphnQLdMC50/GpCo+d7p1r+0SJuXcm DModo/W7Ye4PJJ3rnTS+bmKhDi0toLn9SHP29wogeE4AG/Astiud4fVI3FfvgcCkKxbk aZyA== X-Gm-Message-State: ALoCoQnzwrRpP9lu0wqV9ln+QdRMtXpwuzbgzE4oN7qCA010ejyFaVBjG83CJHqSxSytxTII15nc X-Received: by 10.181.13.236 with SMTP id fb12mr583499wid.1.1424876111546; Wed, 25 Feb 2015 06:55:11 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.208 with SMTP id l16ls744746laa.66.gmail; Wed, 25 Feb 2015 06:55:11 -0800 (PST) X-Received: by 10.112.182.69 with SMTP id ec5mr3003828lbc.118.1424876111174; Wed, 25 Feb 2015 06:55:11 -0800 (PST) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id ja9si16959556lbc.81.2015.02.25.06.55.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Feb 2015 06:55:10 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by lams18 with SMTP id s18so4344118lam.13 for ; Wed, 25 Feb 2015 06:55:10 -0800 (PST) X-Received: by 10.112.188.165 with SMTP id gb5mr3161002lbc.35.1424876110876; Wed, 25 Feb 2015 06:55:10 -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 h5csp2668494lbj; Wed, 25 Feb 2015 06:55:10 -0800 (PST) X-Received: by 10.68.196.136 with SMTP id im8mr5907606pbc.125.1424876109120; Wed, 25 Feb 2015 06:55:09 -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.08 for ; Wed, 25 Feb 2015 06:55:09 -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 S1752716AbbBYOzH (ORCPT ); Wed, 25 Feb 2015 09:55:07 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:40951 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752671AbbBYOzG (ORCPT ); Wed, 25 Feb 2015 09:55:06 -0500 Received: by paceu11 with SMTP id eu11so5766947pac.7 for ; Wed, 25 Feb 2015 06:55:05 -0800 (PST) X-Received: by 10.70.127.131 with SMTP id ng3mr6046685pdb.31.1424876105615; Wed, 25 Feb 2015 06:55:05 -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.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Feb 2015 06:55:05 -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 3/8] drm: armada: fix struct clk pointer comparing Date: Wed, 25 Feb 2015 22:53:33 +0800 Message-Id: <1424876018-17852-4-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.43 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 --- drivers/gpu/drm/armada/armada_510.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/armada/armada_510.c b/drivers/gpu/drm/armada/armada_510.c index ad3d2ebf95c9..862deafe8b24 100644 --- a/drivers/gpu/drm/armada/armada_510.c +++ b/drivers/gpu/drm/armada/armada_510.c @@ -53,7 +53,7 @@ static int armada510_crtc_compute_clock(struct armada_crtc *dcrtc, if (IS_ERR(clk)) return PTR_ERR(clk); - if (dcrtc->clk != clk) { + if (!clk_is_match(dcrtc->clk, clk)) { ret = clk_prepare_enable(clk); if (ret) return ret;