diff options
author | Axel Lin <axel.lin@ingics.com> | 2015-07-16 16:59:43 +0300 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2015-07-28 21:58:46 +0300 |
commit | 264e3b75de4eee6e4ee4616bf2b2a3d522cad72a (patch) | |
tree | 76b68596282ceaa7f153569bc3939d66b5a6b12e /drivers/clk | |
parent | 5a1cfafaeab5237523d43cd033e1fb42bf5c1933 (diff) | |
download | linux-264e3b75de4eee6e4ee4616bf2b2a3d522cad72a.tar.xz |
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>
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/clk-s2mps11.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c index 9b13a303d3f8..ba7fb1b8c182 100644 --- a/drivers/clk/clk-s2mps11.c +++ b/drivers/clk/clk-s2mps11.c @@ -246,7 +246,7 @@ static int s2mps11_clk_probe(struct platform_device *pdev) s2mps11_name(s2mps11_clk), NULL); if (!s2mps11_clk->lookup) { 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); return ret; -err_lup: - devm_clk_unregister(&pdev->dev, s2mps11_clk->clk); + err_reg: - while (s2mps11_clk > s2mps11_clks) { - if (s2mps11_clk->lookup) { - clkdev_drop(s2mps11_clk->lookup); - devm_clk_unregister(&pdev->dev, s2mps11_clk->clk); - } - s2mps11_clk--; - } + while (--i >= 0) + clkdev_drop(s2mps11_clks[i].lookup); return ret; } |