Commit 18d4ecba authored by Paul Walmsley's avatar Paul Walmsley Committed by Tony Lindgren

OMAP2/3 clock: omap2_clk_enable(): refactor usecount check

Clean up omap2_clk_enable() by moving most of the function body out of
the usecount check.  Should result in no functional change.
Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 60b8b431
......@@ -485,7 +485,9 @@ int omap2_clk_enable(struct clk *clk)
{
int ret = 0;
if (clk->usecount++ == 0) {
if (++clk->usecount > 1)
return 0;
if (clk->parent)
ret = omap2_clk_enable(clk->parent);
......@@ -506,7 +508,6 @@ int omap2_clk_enable(struct clk *clk)
clk->usecount--;
}
}
}
return ret;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment