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: 96125 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp1615695qgd; Tue, 28 Mar 2017 02:21:24 -0700 (PDT) X-Received: by 10.84.194.195 with SMTP id h61mr35480610pld.182.1490692884525; Tue, 28 Mar 2017 02:21:24 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v24si3614929pgc.143.2017.03.28.02.21.24; Tue, 28 Mar 2017 02:21:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754783AbdC1JVW (ORCPT + 18 others); Tue, 28 Mar 2017 05:21:22 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:30586 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750716AbdC1JVT (ORCPT ); Tue, 28 Mar 2017 05:21:19 -0400 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 Cc: Stephen Boyd , Ralf Baechle , Michael Turquette , Masahiro Yamada , Wan ZongShun , Russell King , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(+) -- 2.7.4 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);