From patchwork Wed Feb 25 14:53:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 45073 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 CDFC620502 for ; Wed, 25 Feb 2015 14:55:26 +0000 (UTC) Received: by wesu56 with SMTP id u56sf3289684wes.1 for ; Wed, 25 Feb 2015 06:55:26 -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=loeGVAQmSxupsnFfqxIORfMmffPXijJsVYfsUoI2kDE=; b=dm01PtH1V1JC9vpmgYJ1vByFr/Ij82OWJmQDiHoQirLFg7dds+8h0zq0GKvNOzyYWC pFcSx5Pa82stLOTrhc+t5f/LNlE4tiEzdgGFYpXZLlItyWe6I201H2OK/Tx4hS69DNFT YANUiEV1N92m5fCZCzKV1fbQrgMqSZMuZdit299rUpnABwhVvyIA7mHiaNOcEZ4x+Ara o6Zkek8CfCgENAf6ikdwIuvr/cKmrWvQu92si95rNLDH+KIVm59zXKUwORITOv6+Gtp4 CPCFwmJjcLmdmQFus4AJnCbJddPTSxgW6RQZVlklK1/JGDpq1LXf+zUS54bKwSCF9tAT 4UQg== X-Gm-Message-State: ALoCoQnf+i3SapIvi97uAVxr5iq/BWM+2Oftg2gcga52Wccv9ay87SyfU4jmcaSSUplBCyfc0AuI X-Received: by 10.180.83.168 with SMTP id r8mr584832wiy.6.1424876126110; Wed, 25 Feb 2015 06:55:26 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.6 with SMTP id v6ls813392laa.13.gmail; Wed, 25 Feb 2015 06:55:25 -0800 (PST) X-Received: by 10.112.90.193 with SMTP id by1mr2999415lbb.113.1424876125955; Wed, 25 Feb 2015 06:55:25 -0800 (PST) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id r15si27472167lal.131.2015.02.25.06.55.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Feb 2015 06:55:25 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbiw7 with SMTP id w7so4336661lbi.9 for ; Wed, 25 Feb 2015 06:55:25 -0800 (PST) X-Received: by 10.152.115.136 with SMTP id jo8mr3292032lab.32.1424876125855; Wed, 25 Feb 2015 06:55:25 -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 h5csp2668653lbj; Wed, 25 Feb 2015 06:55:25 -0800 (PST) X-Received: by 10.68.248.74 with SMTP id yk10mr6266459pbc.26.1424876124104; Wed, 25 Feb 2015 06:55:24 -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.23 for ; Wed, 25 Feb 2015 06:55:24 -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 S1752796AbbBYOzW (ORCPT ); Wed, 25 Feb 2015 09:55:22 -0500 Received: from mail-pd0-f173.google.com ([209.85.192.173]:34854 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752516AbbBYOzW (ORCPT ); Wed, 25 Feb 2015 09:55:22 -0500 Received: by pdbfl12 with SMTP id fl12so5411326pdb.2 for ; Wed, 25 Feb 2015 06:55:21 -0800 (PST) X-Received: by 10.66.141.176 with SMTP id rp16mr6132556pab.11.1424876121685; Wed, 25 Feb 2015 06:55:21 -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.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Feb 2015 06:55:21 -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 5/8] serial: samsung: fix struct clk pointer comparing Date: Wed, 25 Feb 2015 22:53:35 +0800 Message-Id: <1424876018-17852-6-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.179 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/tty/serial/samsung.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index af821a908720..b747066247df 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -1277,7 +1277,7 @@ static void s3c24xx_serial_set_termios(struct uart_port *port, /* check to see if we need to change clock source */ - if (ourport->baudclk != clk) { + if (!clk_is_match(ourport->baudclk, clk)) { s3c24xx_serial_setsource(port, clk_sel); if (!IS_ERR(ourport->baudclk)) {