clk: s2mps11: Simplify s2mps11_clk_probe unwind paths
Subsystems (2)
PATCH RESEND 1/1 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 <[email protected]>
Reviewed-by Krzysztof Kozlowski <[email protected]>
---
This patch was sent on https://lkml.org/lkml/2014/5/18/96 with Krzysztof's review.
drivers/clk/clk-s2mps11.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
drivers/clk/clk-s2mps11.c +4 -10
@@ -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; }
Signature · 1 line
2.1.0
Stephen Boyd
AppliedQuoted 6 lines · Axel Lin
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 <[email protected]>Reviewed-by Krzysztof Kozlowski <[email protected]>---
Applied to clk-next
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project