m68k: let clk_disable() return immediately if clk is NULL
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Sun, 18 Sep 2016 18:01:14 +0000 (03:01 +0900)
committerGreg Ungerer <gerg@linux-m68k.org>
Mon, 26 Sep 2016 02:02:59 +0000 (12:02 +1000)
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@socionext.com>
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
arch/m68k/coldfire/clk.c

index fddfdccae63b19c0500ed042459ba84e84c2002e..1e3c7e9193d14d0a3c0c6821c1f686d6ef35d02d 100644 (file)
@@ -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);