From patchwork Sun Sep 18 17:58:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 9338049 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 77BA0607D0 for ; Sun, 18 Sep 2016 18:01:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CC6C2893B for ; Sun, 18 Sep 2016 18:01:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 61A9128B55; Sun, 18 Sep 2016 18:01:52 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7D02D2893B for ; Sun, 18 Sep 2016 18:01:50 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1blgNd-0004NO-5R; Sun, 18 Sep 2016 17:59:53 +0000 Received: from conuserg-09.nifty.com ([210.131.2.76]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1blgNX-0004Ln-BB for linux-arm-kernel@lists.infradead.org; Sun, 18 Sep 2016 17:59:48 +0000 Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-09.nifty.com with ESMTP id u8IHwqSO002914; Mon, 19 Sep 2016 02:58:56 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com u8IHwqSO002914 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1474221536; bh=GIXo2S+QGysio/ZYVEW+qF1hVktXzlTnO5hJJjLOpAQ=; h=From:To:Cc:Subject:Date:From; b=JP7BoOK8UoL7dbppf1AvZiYNJpoxGsJUsIeSR7AISP3gqAru0Q4CCEgfTThjcVXxB nxlMqzRfAVoQGiSbp/uoDUfqy7SmSD25kMepVjCJMsP05bMYL+T8Qe+PTRopIeVnkq KHob78hlaE769oNJyGcGzrrzsTIj9bi71o/b0fzlWcBuylJBCrLsGQ3dNDY19Qo9Ij 7WnqGJjNQzZ+FWRypSaPaPggZptTstYy6LKlBCWvd7Dsb90uq7mrAfJmIxj3EIIgsy +/1dJiRELhZ1Ddn2fJ6ExMLwiLfajLRvypLsRk5rfUdzmKMaHAtoE+I38HgYeWtcQy a+VKYq6MqyJRQ== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v4] ARM: mmp: let clk_disable() return immediately if clk is NULL Date: Mon, 19 Sep 2016 02:58:46 +0900 Message-Id: <1474221526-21195-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160918_105947_823431_EA1028F4 X-CRM114-Status: UNSURE ( 8.80 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Miao , Michael Turquette , Stephen Boyd , Russell King , Haojian Zhuang , linux-kernel@vger.kernel.org, Masahiro Yamada , Ralf Baechle MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP In many of clk_disable() implementations, it is a no-op for a NULL pointer input, but this is one of the exceptions. Making it treewide consistent will allow clock consumers to call clk_disable() without NULL pointer check. Signed-off-by: Masahiro Yamada --- Changes in v4: - Split into per-arch patches Changes in v3: - Return only when clk is NULL. Do not take care of error pointer. Changes in v2: - Rebase on Linux 4.6-rc1 arch/arm/mach-mmp/clock.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/mach-mmp/clock.c b/arch/arm/mach-mmp/clock.c index ac6633d..28fe64c 100644 --- a/arch/arm/mach-mmp/clock.c +++ b/arch/arm/mach-mmp/clock.c @@ -67,6 +67,9 @@ void clk_disable(struct clk *clk) { unsigned long flags; + if (!clk) + return; + WARN_ON(clk->enabled == 0); spin_lock_irqsave(&clocks_lock, flags);