Skip to contentSkip to conversation

blackfin: bf609: let clk_disable() return immediately if clk is NULL

PATCH New [email protected] 1 participant 1 message May 3, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 3/102 blackfin: bf609: let clk_disable() return immediately if clk is NULL

From: Masahiro Yamada <[email protected]>
Subject: blackfin: bf609: 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.

---

 arch/blackfin/mach-bf609/clock.c |    3 +++
 1 file changed, 3 insertions(+)
arch/blackfin/mach-bf609/clock.c renamed from arch/blackfin/mach-bf609/clock.c~blackfin-bf609-let-clk_disable-return-immediately-if-clk-is-null +3 -0
diff -puN arch/blackfin/mach-bf609/clock.c~blackfin-bf609-let-clk_disable-return-immediately-if-clk-is-null arch/blackfin/mach-bf609/clock.c
@@ -97,6 +97,9 @@ EXPORT_SYMBOL(clk_enable);
 
 void clk_disable(struct clk *clk)
 {
+	if (!clk)
+		return;
+
 	if (clk->ops && clk->ops->disable)
 		clk->ops->disable(clk);
 }

_