aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pwm
diff options
context:
space:
mode:
authorAlban Bedel <alban.bedel@avionic-design.de>2012-11-14 06:58:14 -0500
committerThierry Reding <thierry.reding@avionic-design.de>2012-12-06 02:52:11 -0500
commit54b2a999a167510aa6eb54f49ef21a40946c88ba (patch)
treec59e98ae4587f541e8e63ee6144ba0e4f5b70214 /drivers/pwm
parenta9a18e0691228707230df660dd56364aebf6ea47 (diff)
pwm: lpc32xx: Properly disable the clock on device removal
A single clock is used for all PWMs meaning the clock's reference count might be between 0 and N when .remove() is called. Instead of a single clk_disable() call pwm_disable() on each PWM, to ensure that clk_disable() is called for each PWM that is still enabled. Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de> Acked-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com> Acked-by: Roland Stigge <stigge@antcom.de> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Diffstat (limited to 'drivers/pwm')
-rw-r--r--drivers/pwm/pwm-lpc32xx.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/pwm/pwm-lpc32xx.c b/drivers/pwm/pwm-lpc32xx.c
index c9b2eb5932b1..971874b0707a 100644
--- a/drivers/pwm/pwm-lpc32xx.c
+++ b/drivers/pwm/pwm-lpc32xx.c
@@ -136,8 +136,11 @@ static int lpc32xx_pwm_probe(struct platform_device *pdev)
136static int __devexit lpc32xx_pwm_remove(struct platform_device *pdev) 136static int __devexit lpc32xx_pwm_remove(struct platform_device *pdev)
137{ 137{
138 struct lpc32xx_pwm_chip *lpc32xx = platform_get_drvdata(pdev); 138 struct lpc32xx_pwm_chip *lpc32xx = platform_get_drvdata(pdev);
139 unsigned int i;
140
141 for (i = 0; i < lpc32xx->chip.npwm; i++)
142 pwm_disable(&lpc32xx->chip.pwms[i]);
139 143
140 clk_disable(lpc32xx->clk);
141 return pwmchip_remove(&lpc32xx->chip); 144 return pwmchip_remove(&lpc32xx->chip);
142} 145}
143 146