Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755920AbcLAG0f (ORCPT ); Thu, 1 Dec 2016 01:26:35 -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 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 796 Lines: 26 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 --- 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; -- 1.9.1