From patchwork Sun Sep 18 18:01:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 76488 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp610629qgf; Sun, 18 Sep 2016 11:02:11 -0700 (PDT) X-Received: by 10.66.245.177 with SMTP id xp17mr40617607pac.118.1474221731041; Sun, 18 Sep 2016 11:02:11 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q7si24028623pay.47.2016.09.18.11.02.10; Sun, 18 Sep 2016 11:02:11 -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 S1758313AbcIRSCJ (ORCPT + 27 others); Sun, 18 Sep 2016 14:02:09 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:32428 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751581AbcIRSCA (ORCPT ); Sun, 18 Sep 2016 14:02:00 -0400 Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-12.nifty.com with ESMTP id u8II1HPS029538; Mon, 19 Sep 2016 03:01:20 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com u8II1HPS029538 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1474221681; bh=CMlCj/C6UvV33L3W8FWm0QbfYPk61Zp8NyACD3Qhn44=; h=From:To:Cc:Subject:Date:From; b=dWNjNQRBHWnHGPnhjFjU740SoyfXDm16jzOIcyfsZtAuZsvu4jXKDijB5BFI93eBW 6mwaUmCJ+4m9Y8Yw6cmiTqSVHkTk9vz0TSlvFaySsB6UJq7lcnlwxp0vxr1DDXBZV8 P55YfDbfNipfKVHxi4zwLQI8H8Zhc84zWC82EAsw2E1CLTj7LPGiXleF+Jzm5HnIPQ 9tf6JDzogCywhBGqAgEEzLo9lIQlBZnE9CE84bdDYiMpeSX+PUR1bGHd4LL+cGUfYN Ng2R4q15utpR01exRIF0Ex7XiooFOD5d4FocGSPhq/R+X1rQwdjdYxUBsqJsFDbvQ6 EBxIbnnZ4Yepg== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: linux-m68k@lists.linux-m68k.org Cc: Stephen Boyd , Ralf Baechle , Michael Turquette , Masahiro Yamada , Geert Uytterhoeven , Greg Ungerer , linux-kernel@vger.kernel.org Subject: [PATCH v4] m68k: let clk_disable() return immediately if clk is NULL Date: Mon, 19 Sep 2016 03:01:14 +0900 Message-Id: <1474221674-21625-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 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: Greg Ungerer --- 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/m68k/coldfire/clk.c | 4 ++++ 1 file changed, 4 insertions(+) -- 1.9.1 diff --git a/arch/m68k/coldfire/clk.c b/arch/m68k/coldfire/clk.c index fddfdcc..1e3c7e9 100644 --- a/arch/m68k/coldfire/clk.c +++ b/arch/m68k/coldfire/clk.c @@ -101,6 +101,10 @@ EXPORT_SYMBOL(clk_enable); void clk_disable(struct clk *clk) { unsigned long flags; + + if (!clk) + return; + spin_lock_irqsave(&clk_lock, flags); if ((--clk->enabled == 0) && clk->clk_ops) clk->clk_ops->disable(clk);