All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] clk: s2mps11: Simplify s2mps11_clk_probe unwind paths
@ 2014-06-15 15:30 Axel Lin
  0 siblings, 0 replies; 3+ messages in thread
From: Axel Lin @ 2014-06-15 15:30 UTC (permalink / raw)
  To: Mike Turquette; +Cc: Yadwinder Singh Brar, Krzysztof Kozlowski, linux-kernel

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>
---
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(-)

diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
index f2f62a1b..aeaa61c 100644
--- a/drivers/clk/clk-s2mps11.c
+++ b/drivers/clk/clk-s2mps11.c
@@ -210,7 +210,7 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
 					sizeof(struct clk_lookup), GFP_KERNEL);
 		if (!s2mps11_clk->lookup) {
 			ret = -ENOMEM;
-			goto err_lup;
+			goto err_reg;
 		}
 
 		s2mps11_clk->lookup->con_id = s2mps11_name(s2mps11_clk);
@@ -231,16 +231,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;
 }
-- 
1.8.3.2




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH RESEND] clk: s2mps11: Simplify s2mps11_clk_probe unwind paths
@ 2015-07-16 13:59 Axel Lin
  2015-07-16 18:07 ` Stephen Boyd
  0 siblings, 1 reply; 3+ messages in thread
From: Axel Lin @ 2015-07-16 13:59 UTC (permalink / raw)
  To: Stephen Boyd, Michael Turquette; +Cc: Krzysztof Kozlowski, linux-clk

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>
---
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(-)

diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
index 9b13a30..ba7fb1b 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;
 }
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH RESEND] clk: s2mps11: Simplify s2mps11_clk_probe unwind paths
  2015-07-16 13:59 [PATCH RESEND] clk: s2mps11: Simplify s2mps11_clk_probe unwind paths Axel Lin
@ 2015-07-16 18:07 ` Stephen Boyd
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2015-07-16 18:07 UTC (permalink / raw)
  To: Axel Lin; +Cc: Michael Turquette, Krzysztof Kozlowski, linux-clk

On 07/16, Axel Lin wrote:
> 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>
> ---

Applied to clk-next

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-16 18:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-16 13:59 [PATCH RESEND] clk: s2mps11: Simplify s2mps11_clk_probe unwind paths Axel Lin
2015-07-16 18:07 ` Stephen Boyd
  -- strict thread matches above, loose matches on Subject: below --
2014-06-15 15:30 Axel Lin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.