mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-07 07:08:07 +00:00
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>
This commit is contained in:
parent
84ea61f65d
commit
1a0c97b646
1 changed files with 3 additions and 1 deletions
|
@ -485,11 +485,13 @@ static int ehrpwm_pwm_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct ehrpwm_pwm_chip *pc = platform_get_drvdata(pdev);
|
struct ehrpwm_pwm_chip *pc = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
|
pwmchip_remove(&pc->chip);
|
||||||
|
|
||||||
clk_unprepare(pc->tbclk);
|
clk_unprepare(pc->tbclk);
|
||||||
|
|
||||||
pm_runtime_disable(&pdev->dev);
|
pm_runtime_disable(&pdev->dev);
|
||||||
|
|
||||||
return pwmchip_remove(&pc->chip);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM_SLEEP
|
#ifdef CONFIG_PM_SLEEP
|
||||||
|
|
Loading…
Add table
Reference in a new issue