summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2021-07-07 18:27:56 +0200
committerThierry Reding <thierry.reding@gmail.com>2021-09-02 21:38:38 +0200
commit1a0c97b6460f30d8b164eaef07d77369e466dda3 (patch)
tree3a4a9ddca603c8e78a8c6981e0c6bf428ac0a311
parentpwm: rockchip: Unprepare clocks only after the PWM was unregistered (diff)
downloadlinux-1a0c97b6460f30d8b164eaef07d77369e466dda3.tar.xz
linux-1a0c97b6460f30d8b164eaef07d77369e466dda3.zip
pwm: tiehrpwm: Unprepare clock only after the PWM was unregistered
The driver is supposed to stay functional until pwmchip_remove() returns. So disable clocks only after that. pwmchip_remove() always returns 0, so the return code can be ignored which keeps ehrpwm_pwm_remove() a bit simpler and eventually allows to make pwmchip_remove() return void. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
-rw-r--r--drivers/pwm/pwm-tiehrpwm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/pwm/pwm-tiehrpwm.c b/drivers/pwm/pwm-tiehrpwm.c
index 17909fa53211..5b723a48c5f1 100644
--- a/drivers/pwm/pwm-tiehrpwm.c
+++ b/drivers/pwm/pwm-tiehrpwm.c
@@ -485,11 +485,13 @@ static int ehrpwm_pwm_remove(struct platform_device *pdev)
{
struct ehrpwm_pwm_chip *pc = platform_get_drvdata(pdev);
+ pwmchip_remove(&pc->chip);
+
clk_unprepare(pc->tbclk);
pm_runtime_disable(&pdev->dev);
- return pwmchip_remove(&pc->chip);
+ return 0;
}
#ifdef CONFIG_PM_SLEEP