Skip to content

Commit

Permalink
m68k: let clk_disable() return immediately if clk is NULL
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Greg Ungerer <[email protected]>
  • Loading branch information
masahir0y authored and Greg Ungerer committed Sep 26, 2016
1 parent 3ec53d6 commit 742859a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/m68k/coldfire/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 742859a

Please sign in to comment.