Skip to content

Commit 75b5895

Browse files
Uwe Kleine-Königclaudiubeznea
authored andcommitted
pwm: atmel: 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: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
1 parent 3a2661c commit 75b5895

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/pwm/pwm-atmel.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,12 @@ static int atmel_pwm_remove(struct platform_device *pdev)
450450
{
451451
struct atmel_pwm_chip *atmel_pwm = platform_get_drvdata(pdev);
452452

453+
pwmchip_remove(&atmel_pwm->chip);
454+
453455
clk_unprepare(atmel_pwm->clk);
454456
mutex_destroy(&atmel_pwm->isr_lock);
455457

456-
return pwmchip_remove(&atmel_pwm->chip);
458+
return 0;
457459
}
458460

459461
static struct platform_driver atmel_pwm_driver = {

0 commit comments

Comments
 (0)