ARM: w90x900: let clk_disable() return immediately if clk is NULL
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 28 Mar 2017 09:17:03 +0000 (18:17 +0900)
committerArnd Bergmann <arnd@arndb.de>
Thu, 30 Mar 2017 15:37:19 +0000 (17:37 +0200)
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>
Acked-by: Wan Zongshun <mcuos.com@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
arch/arm/mach-w90x900/clock.c

index 2c371ff22e517ad17776902f5af31e8e198d1a66..ac6fd1a2cb59fb43897d00581d18e53aa354ca80 100644 (file)
@@ -46,6 +46,9 @@ void clk_disable(struct clk *clk)
 {
        unsigned long flags;
 
+       if (!clk)
+               return;
+
        WARN_ON(clk->enabled == 0);
 
        spin_lock_irqsave(&clocks_lock, flags);