From patchwork Thu Dec 1 06:25:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pan Bian X-Patchwork-Id: 9455497 X-Patchwork-Delegate: sboyd@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 97A2A60515 for ; Thu, 1 Dec 2016 06:26:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88F8928489 for ; Thu, 1 Dec 2016 06:26:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D63C2848E; Thu, 1 Dec 2016 06:26:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 212B728489 for ; Thu, 1 Dec 2016 06:26:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751029AbcLAG0e (ORCPT ); Thu, 1 Dec 2016 01:26:34 -0500 Received: from m12-11.163.com ([220.181.12.11]:34783 "EHLO m12-11.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750847AbcLAG0d (ORCPT ); Thu, 1 Dec 2016 01:26:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=b2ImeLf4Tp+2CfCX4L g7Yrwj8FtONLWxWJV/7maAv24=; b=nK7yNbVaSxZWT35GciL6iHjltARYnCtBFs wLBSG/wZXCXYZAjJlRuyVUPH5Bs55vp/vFZi1929HKejwKe3SWZO07nroCNMZVFq w3fL08rn+3bvtYy3ixTa1bcC7KCXmmp9MaJNwQoutCaqz/Tcd/9e1cUeVJS0jZOe ZXGSDEdzI= Received: from localhost.localdomain (unknown [106.120.213.17]) by smtp7 (Coremail) with SMTP id C8CowAC39Nlpwj9Y_u2KEg--.48576S3; Thu, 01 Dec 2016 14:25:49 +0800 (CST) From: Pan Bian To: Michael Turquette , Stephen Boyd Cc: patches@opensource.wolfsonmicro.com, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Pan Bian Subject: [PATCH 1/1] clk: clk-wm831x: fix a logic error Date: Thu, 1 Dec 2016 14:25:44 +0800 Message-Id: <1480573545-18588-1-git-send-email-bianpan2016@163.com> X-Mailer: git-send-email 1.9.1 X-CM-TRANSID: C8CowAC39Nlpwj9Y_u2KEg--.48576S3 X-Coremail-Antispam: 1Uf129KBjvdXoWrtFykZw1xXw17Cr43Gr18Grg_yoW3trc_WF 1kur1xKrsYkr129w48Gw4Ivr9Ikrn8uw18Xa43t3W5tryxCFZ8ZrW5Z3Z8Ar48WrZ3KFW5 G3W8GrWUG3W7ujkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUYL6pPUUUUU== X-Originating-IP: [106.120.213.17] X-CM-SenderInfo: held01tdqsiiqw6rljoofrz/xtbBZAYzclQG604PAAAAsb Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix bug https://bugzilla.kernel.org/show_bug.cgi?id=188561. Function wm831x_clkout_is_prepared() returns "true" when it fails to read CLOCK_CONTROL_1. "true" means the device is already prepared. So return "true" on the read failure seems improper. Signed-off-by: Pan Bian Acked-by: Charles Keepax --- drivers/clk/clk-wm831x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/clk-wm831x.c b/drivers/clk/clk-wm831x.c index f4fdac5..0621fbf 100644 --- a/drivers/clk/clk-wm831x.c +++ b/drivers/clk/clk-wm831x.c @@ -243,7 +243,7 @@ static int wm831x_clkout_is_prepared(struct clk_hw *hw) if (ret < 0) { dev_err(wm831x->dev, "Unable to read CLOCK_CONTROL_1: %d\n", ret); - return true; + return false; } return (ret & WM831X_CLKOUT_ENA) != 0;