Commit 3c817469 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Thierry Reding

pwm: bcm2835: Free resources only after pwmchip_remove()

Before pwmchip_remove() returns the PWM is expected to be functional. So
remove the pwmchip before disabling the clock.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent d4ac3917
...@@ -179,9 +179,11 @@ static int bcm2835_pwm_remove(struct platform_device *pdev) ...@@ -179,9 +179,11 @@ static int bcm2835_pwm_remove(struct platform_device *pdev)
{ {
struct bcm2835_pwm *pc = platform_get_drvdata(pdev); struct bcm2835_pwm *pc = platform_get_drvdata(pdev);
pwmchip_remove(&pc->chip);
clk_disable_unprepare(pc->clk); clk_disable_unprepare(pc->clk);
return pwmchip_remove(&pc->chip); return 0;
} }
static const struct of_device_id bcm2835_pwm_of_match[] = { static const struct of_device_id bcm2835_pwm_of_match[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment