summaryrefslogtreecommitdiffstats
path: root/drivers/pwm/pwm-bcm-iproc.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2021-03-24 21:01:34 +0100
committerThierry Reding <thierry.reding@gmail.com>2021-04-09 14:33:10 +0200
commitd4ac3917bca64a4f630dc6f7ba47fe71dbf0273e (patch)
treefbe469df897913f42ddc92a56f1b9b2c12e8807f /drivers/pwm/pwm-bcm-iproc.c
parentpwm: atmel: Free resources only after pwmchip_remove() (diff)
downloadlinux-d4ac3917bca64a4f630dc6f7ba47fe71dbf0273e.tar.xz
linux-d4ac3917bca64a4f630dc6f7ba47fe71dbf0273e.zip
pwm: bcm-iproc: 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> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm/pwm-bcm-iproc.c')
-rw-r--r--drivers/pwm/pwm-bcm-iproc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/pwm/pwm-bcm-iproc.c b/drivers/pwm/pwm-bcm-iproc.c
index 529a66ab692d..edd2ce1760ab 100644
--- a/drivers/pwm/pwm-bcm-iproc.c
+++ b/drivers/pwm/pwm-bcm-iproc.c
@@ -253,9 +253,11 @@ static int iproc_pwmc_remove(struct platform_device *pdev)
{
struct iproc_pwmc *ip = platform_get_drvdata(pdev);
+ pwmchip_remove(&ip->chip);
+
clk_disable_unprepare(ip->clk);
- return pwmchip_remove(&ip->chip);
+ return 0;
}
static const struct of_device_id bcm_iproc_pwmc_dt[] = {