From patchwork Tue Mar 28 09:17:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 9648615 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 8F828601D7 for ; Tue, 28 Mar 2017 09:35:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78C9325F31 for ; Tue, 28 Mar 2017 09:35:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D6B9282E8; Tue, 28 Mar 2017 09:35:47 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F0F7A25F31 for ; Tue, 28 Mar 2017 09:35:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=wZnf70Y8rBtWZQdLMyQr7KUATaFqWmFJ/20MEu0aAuA=; b=ElSZpIMMBsPgfBiPrHY8jdVSQV a+WHe5NSsJ8y/h18A8rJvDc35aLR8zBwm6sjljRxdIEFb3yN5Q9LHznxkI4Pp5XcyvTmC3Ozi8v/F qFIBBzMhkHqKOseGDVW78BUgOgtp44oLB1miLynxXzFYMvXLtAKVjnLkXT2+qh/dAq4Q9t6Gp3GfL WbUBYT8Hk9WNE+hIji0cspNVGq+DjsC4zFtCagsBfmiFHnL3DUrhnmrMbpPTPn3CG7DeckVplWkcz ts2M0ycM5HPj+oF0Mx1xuMekKBGZALmZBRsER7MtGvv3USwmVeQ5GlZlja1IlGC0TR3CMoqSpHaLv uAXMQbYw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1csnXT-0008BN-Oe; Tue, 28 Mar 2017 09:35:43 +0000 Received: from conuserg-11.nifty.com ([210.131.2.78]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1csnHR-0004Sy-Vm for linux-arm-kernel@lists.infradead.org; Tue, 28 Mar 2017 09:19:14 +0000 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id v2S9Hu2r004893; Tue, 28 Mar 2017 18:17:58 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com v2S9Hu2r004893 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1490692679; bh=74NkhjVNpuUb8Er0Q5cHliccrI0C/0x5O7q7tR2onXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AhzCWSgKVIeFaB+7Hmg1jcvn7cikzwUK46o/35vJ4cYceFgSGEJZvDHZW5AfiaPH4 QvlPLeoW640AhhVzo5GRkfNkDcl5wbrfU/L1pOo35BET5xUGKXCbzUFxNUgjolTJNH 4qPbijxEEXkNHDMEw/494Y5rijsmZJz3uy0Comh/CUm1Ob+YkPsa9SbRomrOON6IIY ld/rlTr1wKmvg32/O7URB1COV4MQ9uJQlYTaaxce+2Xnd6PLWdU8T/oKZuDRZfSCt1 IRmUbwYkWWDuxDiRD9wM3EmoAjbVwIpA0xRQGq1NwJPDIZem/Jl0a8dxVBUc75gAm7 BThmdIUtX6fzg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Andrew Morton Subject: [PATCH v5 2/3] ARM: w90x900: let clk_disable() return immediately if clk is NULL Date: Tue, 28 Mar 2017 18:17:03 +0900 Message-Id: <1490692624-11931-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490692624-11931-1-git-send-email-yamada.masahiro@socionext.com> References: <1490692624-11931-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170328_021910_648320_F11C6908 X-CRM114-Status: UNSURE ( 8.88 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wan ZongShun , Michael Turquette , Stephen Boyd , Russell King , Ralf Baechle , linux-kernel@vger.kernel.org, Masahiro Yamada , linux-arm-kernel@lists.infradead.org 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 Acked-by: Wan Zongshun --- Changes in v5: None 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-w90x900/clock.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/mach-w90x900/clock.c b/arch/arm/mach-w90x900/clock.c index 2c371ff..ac6fd1a 100644 --- a/arch/arm/mach-w90x900/clock.c +++ b/arch/arm/mach-w90x900/clock.c @@ -46,6 +46,9 @@ void clk_disable(struct clk *clk) { unsigned long flags; + if (!clk) + return; + WARN_ON(clk->enabled == 0); spin_lock_irqsave(&clocks_lock, flags);