From patchwork Tue Aug 2 11:26:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Lothar_Wa=C3=9Fmann?= X-Patchwork-Id: 107897 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 99F3BB71CA for ; Tue, 2 Aug 2011 21:26:50 +1000 (EST) Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QoD7T-00038Y-Ql; Tue, 02 Aug 2011 11:26:43 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QoD7T-00032x-CZ; Tue, 02 Aug 2011 11:26:43 +0000 Received: from mail.karo-electronics.de ([81.173.242.67]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QoD7R-00032g-1K for linux-arm-kernel@lists.infradead.org; Tue, 02 Aug 2011 11:26:42 +0000 From: =?utf-8?q?Lothar=20Wa=C3=9Fmann?= To: linux-kernel@vger.kernel.org Subject: [BUGFIX][PATCH] Fix double inversion bug in clk_disable() Date: Tue, 2 Aug 2011 13:26:30 +0200 Message-Id: <1312284390-20244-1-git-send-email-LW@KARO-electronics.de> X-Mailer: git-send-email 1.5.6.5 MIME-Version: 1.0 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110802_072641_648119_3BD99E8A X-CRM114-Status: UNSURE ( 9.38 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.8 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Jeremy Kerr , linux-arm-kernel@lists.infradead.org, =?utf-8?q?Lothar=20Wa=C3=9Fmann?= X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org The condition check for calling the low level disable function is wrong due to double inversion via '!' and '== 0'. Signed-off-by: Lothar Waßmann --- drivers/clk/clk.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 83c6b67..1525e2a 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -81,7 +81,7 @@ void clk_disable(struct clk *clk) WARN_ON(clk->enable_count == 0); - if (!--clk->enable_count == 0 && clk->ops->disable) + if (--clk->enable_count == 0 && clk->ops->disable) clk->ops->disable(clk); spin_unlock_irqrestore(&clk->enable_lock, flags);