All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pwm: Convert pwm-tegra to use devm_clk_get()
@ 2012-07-01  5:00 Axel Lin
  2012-07-02 20:46 ` Thierry Reding
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2012-07-01  5:00 UTC (permalink / raw)
  To: Thierry Reding; +Cc: linux-kernel, Stephen Warren

Also return proper error in tegra_pwm_remove() if pwmchip_remove() fails.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/pwm/pwm-tegra.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/pwm/pwm-tegra.c b/drivers/pwm/pwm-tegra.c
index 472b74e..02ce18d 100644
--- a/drivers/pwm/pwm-tegra.c
+++ b/drivers/pwm/pwm-tegra.c
@@ -194,7 +194,7 @@ static int tegra_pwm_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, pwm);
 
-	pwm->clk = clk_get(&pdev->dev, NULL);
+	pwm->clk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(pwm->clk))
 		return PTR_ERR(pwm->clk);
 
@@ -206,7 +206,6 @@ static int tegra_pwm_probe(struct platform_device *pdev)
 	ret = pwmchip_add(&pwm->chip);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret);
-		clk_put(pwm->clk);
 		return ret;
 	}
 
@@ -233,10 +232,7 @@ static int __devexit tegra_pwm_remove(struct platform_device *pdev)
 		clk_disable_unprepare(pc->clk);
 	}
 
-	pwmchip_remove(&pc->chip);
-	clk_put(pc->clk);
-
-	return 0;
+	return pwmchip_remove(&pc->chip);
 }
 
 #ifdef CONFIG_OF
-- 
1.7.9.5




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

* Re: [PATCH] pwm: Convert pwm-tegra to use devm_clk_get()
  2012-07-01  5:00 [PATCH] pwm: Convert pwm-tegra to use devm_clk_get() Axel Lin
@ 2012-07-02 20:46 ` Thierry Reding
  0 siblings, 0 replies; 2+ messages in thread
From: Thierry Reding @ 2012-07-02 20:46 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Stephen Warren

[-- Attachment #1: Type: text/plain, Size: 322 bytes --]

On Sun, Jul 01, 2012 at 01:00:51PM +0800, Axel Lin wrote:
> Also return proper error in tegra_pwm_remove() if pwmchip_remove() fails.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
>  drivers/pwm/pwm-tegra.c |    8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)

Applied, thanks.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2012-07-02 20:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-01  5:00 [PATCH] pwm: Convert pwm-tegra to use devm_clk_get() Axel Lin
2012-07-02 20:46 ` Thierry Reding

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.