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: 5880641 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5F3CFBF440 for ; Wed, 25 Feb 2015 14:58:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 977E920373 for ; Wed, 25 Feb 2015 14:58:13 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 5928F20263 for ; Wed, 25 Feb 2015 14:58:12 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id DE76F2619D7; Wed, 25 Feb 2015 15:58:10 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 8DE94261536; Wed, 25 Feb 2015 15:56:14 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 85E2E261528; Wed, 25 Feb 2015 15:56:12 +0100 (CET) Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by alsa0.perex.cz (Postfix) with ESMTP id 90A5E26069D for ; Wed, 25 Feb 2015 15:55:22 +0100 (CET) Received: by pdjg10 with SMTP id g10so5422534pdj.1 for ; Wed, 25 Feb 2015 06:55:21 -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=9ZsEHgUnFWYjWMMyB3PFKDb42z3ADJIV8anA36eH+n0=; b=h13glWoXmT5cqctUPRCZvqRafkAe1sRHb0fIxrBbxNb/d5qBgWiX3diygytXYlb7V7 6NuViGeh0zhP4fZqdS8ajEiISYVJd+4ebqOLQt9RcBIBect67lg0lRn+yDncsKpLj+Kb FFZ9YH3Wpt8VaB7Dw6OIxVWmPqGbBDN1PmCH95Dyk+irRMGPPIMGS98Ksvb1/WRiPMjl YSiZ+G5HQcH4cTb4lrW8Ffb1t/C2KKOxo+EZJuFEfgJmXVLyQnmcMPqahEf54W7I+mLs MKEWfQUNYrCk5S+VDl63EEh9GdZ6FTAul22KkCUwwj2ccOFXBEtvPQznj4tg7OfrOuX1 Hiww== X-Gm-Message-State: ALoCoQnjvOpmHm4Uc8mBe1EoXUMchUZD9KfFUZq78dK1wZau8DUhBSvQgxZtirOxabNyet29YNtu 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 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> 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 Subject: [alsa-devel] [PATCH 5/8] serial: samsung: fix struct clk pointer comparing X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.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 --- 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)) {