From patchwork Sun Sep 18 18:04:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 76490 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp612041qgf; Sun, 18 Sep 2016 11:06:14 -0700 (PDT) X-Received: by 10.98.33.146 with SMTP id o18mr26926627pfj.177.1474221974405; Sun, 18 Sep 2016 11:06:14 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rw6si24046724pab.162.2016.09.18.11.06.14; Sun, 18 Sep 2016 11:06:14 -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 S1758261AbcIRSGF (ORCPT + 27 others); Sun, 18 Sep 2016 14:06:05 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:43663 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757114AbcIRSF5 (ORCPT ); Sun, 18 Sep 2016 14:05:57 -0400 Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-10.nifty.com with ESMTP id u8II4aDd017348; Mon, 19 Sep 2016 03:04:39 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com u8II4aDd017348 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1474221879; bh=WwXnpdHNicD9zDdJA5Y3AIhwZMLkHt7yHQqPbng5lNw=; h=From:To:Cc:Subject:Date:From; b=kew6G0RvbMZerneS/fK5o2PziNYGqRLrC/8M20fNIL6UPQ5y0WL7uLPY+UUJsq+rl WN2qjUGONOivBnPGgelntMLzNAk3Y62JceiZpS4QNbWdSJDzwaYY35IAY9LeSQiLE1 1IR5etmm4twkEbDNwDUq5AOzXBjV5zI7/9pZ/hS7agcu0PycOcYEyMfo4yz9tFz0nS l7WY0NNdKxCqr9jwMPesgCAvhDjDwsKpZffk+P/xNafep23ilDjg0j8KhhsqNZodNQ CndK3nbt0XvfDeCEGVBqEWc8jjCK+5mqsBvBI9xYq6gKWu1lv2mq6Ym1imSZ5/0U2j PfQlrKQ8bFlzw== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: Ralf Baechle , linux-mips@linux-mips.org Cc: Stephen Boyd , Michael Turquette , Masahiro Yamada , linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, Florian Fainelli , linux-arm-kernel@lists.infradead.org Subject: [PATCH v4] MIPS: bcm63xx: let clk_disable() return immediately if clk is NULL Date: Mon, 19 Sep 2016 03:04:35 +0900 Message-Id: <1474221875-22687-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 --- 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/mips/bcm63xx/clk.c | 3 +++ 1 file changed, 3 insertions(+) -- 1.9.1 diff --git a/arch/mips/bcm63xx/clk.c b/arch/mips/bcm63xx/clk.c index 6375652..b49fc9c 100644 --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c @@ -326,6 +326,9 @@ EXPORT_SYMBOL(clk_enable); void clk_disable(struct clk *clk) { + if (!clk) + return; + mutex_lock(&clocks_mutex); clk_disable_unlocked(clk); mutex_unlock(&clocks_mutex);