[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1341118851.8998.4.camel@phoenix>
Date: Sun, 01 Jul 2012 13:00:51 +0800
From: Axel Lin <axel.lin@...il.com>
To: Thierry Reding <thierry.reding@...onic-design.de>
Cc: linux-kernel@...r.kernel.org, Stephen Warren <swarren@...dia.com>
Subject: [PATCH] pwm: Convert pwm-tegra to use devm_clk_get()
Also return proper error in tegra_pwm_remove() if pwmchip_remove() fails.
Signed-off-by: Axel Lin <axel.lin@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists