1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

clk: s2mps11: Simplify s2mps11_clk_probe unwind paths

The devm_clk_unregister() in .probe error case is not necessary as it will
be automatically called when probe fails.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This commit is contained in:
Axel Lin 2015-07-16 21:59:43 +08:00 committed by Stephen Boyd
parent 5a1cfafaea
commit 264e3b75de

View file

@ -246,7 +246,7 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
s2mps11_name(s2mps11_clk), NULL); s2mps11_name(s2mps11_clk), NULL);
if (!s2mps11_clk->lookup) { if (!s2mps11_clk->lookup) {
ret = -ENOMEM; ret = -ENOMEM;
goto err_lup; goto err_reg;
} }
} }
@ -265,16 +265,10 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, s2mps11_clks); platform_set_drvdata(pdev, s2mps11_clks);
return ret; return ret;
err_lup:
devm_clk_unregister(&pdev->dev, s2mps11_clk->clk);
err_reg: err_reg:
while (s2mps11_clk > s2mps11_clks) { while (--i >= 0)
if (s2mps11_clk->lookup) { clkdev_drop(s2mps11_clks[i].lookup);
clkdev_drop(s2mps11_clk->lookup);
devm_clk_unregister(&pdev->dev, s2mps11_clk->clk);
}
s2mps11_clk--;
}
return ret; return ret;
} }