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

pwm: atmel-tcb: Only free resources after pwm_chip_remove() returned

Otherwise the PWM stops working before the PWM core and its consumers
are aware the device is going away.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 30882cf1
...@@ -507,14 +507,14 @@ static int atmel_tcb_pwm_remove(struct platform_device *pdev) ...@@ -507,14 +507,14 @@ static int atmel_tcb_pwm_remove(struct platform_device *pdev)
struct atmel_tcb_pwm_chip *tcbpwm = platform_get_drvdata(pdev); struct atmel_tcb_pwm_chip *tcbpwm = platform_get_drvdata(pdev);
int err; int err;
clk_disable_unprepare(tcbpwm->slow_clk);
clk_put(tcbpwm->slow_clk);
clk_put(tcbpwm->clk);
err = pwmchip_remove(&tcbpwm->chip); err = pwmchip_remove(&tcbpwm->chip);
if (err < 0) if (err < 0)
return err; return err;
clk_disable_unprepare(tcbpwm->slow_clk);
clk_put(tcbpwm->slow_clk);
clk_put(tcbpwm->clk);
return 0; return 0;
} }
......
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