Rearrange the parent clock enable status check code so it actually makes
sense. No functional change.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
int omap2_clk_enable(struct clk *clk)
{
- int ret = 0;
+ int ret;
if (++clk->usecount > 1)
return 0;
omap2_clkdm_clk_enable(clk->clkdm.ptr, clk);
- if (clk->parent)
- ret = omap2_clk_enable(clk->parent);
+ if (clk->parent) {
+ int parent_ret;
- if (ret != 0) {
- clk->usecount--;
- omap2_clkdm_clk_disable(clk->clkdm.ptr, clk);
- return ret;
+ parent_ret = omap2_clk_enable(clk->parent);
+
+ if (parent_ret != 0) {
+ clk->usecount--;
+ omap2_clkdm_clk_disable(clk->clkdm.ptr, clk);
+ return parent_ret;
+ }
}
ret = _omap2_clk_enable(clk);