summaryrefslogtreecommitdiffstats
path: root/drivers/pwm
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2021-03-25 09:29:31 +0100
committerThierry Reding <thierry.reding@gmail.com>2021-04-09 14:33:39 +0200
commit3c817469a53d93bbae52f8ead207dc0b9aeebae9 (patch)
tree7051f889531571bd1123687d8ccc7054f15f4462 /drivers/pwm
parentpwm: bcm-iproc: Free resources only after pwmchip_remove() (diff)
downloadlinux-3c817469a53d93bbae52f8ead207dc0b9aeebae9.tar.xz
linux-3c817469a53d93bbae52f8ead207dc0b9aeebae9.zip
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: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm')
-rw-r--r--drivers/pwm/pwm-bcm2835.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/pwm/pwm-bcm2835.c b/drivers/pwm/pwm-bcm2835.c
index e4b54675b356..fc240d5b8121 100644
--- a/drivers/pwm/pwm-bcm2835.c
+++ b/drivers/pwm/pwm-bcm2835.c
@@ -179,9 +179,11 @@ static int bcm2835_pwm_remove(struct platform_device *pdev)
{
struct bcm2835_pwm *pc = platform_get_drvdata(pdev);
+ pwmchip_remove(&pc->chip);
+
clk_disable_unprepare(pc->clk);
- return pwmchip_remove(&pc->chip);
+ return 0;
}
static const struct of_device_id bcm2835_pwm_of_match[] = {