[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1474221875-22687-1-git-send-email-yamada.masahiro@socionext.com>
Date: Mon, 19 Sep 2016 03:04:35 +0900
From: Masahiro Yamada <yamada.masahiro@...ionext.com>
To: Ralf Baechle <ralf@...ux-mips.org>, linux-mips@...ux-mips.org
Cc: Stephen Boyd <sboyd@...eaurora.org>,
Michael Turquette <mturquette@...libre.com>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
linux-kernel@...r.kernel.org,
bcm-kernel-feedback-list@...adcom.com,
Florian Fainelli <f.fainelli@...il.com>,
linux-arm-kernel@...ts.infradead.org
Subject: [PATCH v4] MIPS: bcm63xx: let clk_disable() return immediately if clk is NULL
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 <yamada.masahiro@...ionext.com>
---
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(+)
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);
--
1.9.1
Powered by blists - more mailing lists