Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pwm: sti: Free resources only after pwmchip_remove()

Before pwmchip_remove() returns the PWM is expected to be functional. So
remove the pwmchip before disabling the clocks.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>

authored by

Uwe Kleine-König and committed by
Thierry Reding
0e719e8c a9ea2e79

+2 -1
+2 -1
drivers/pwm/pwm-sti.c
··· 650 650 { 651 651 struct sti_pwm_chip *pc = platform_get_drvdata(pdev); 652 652 653 + pwmchip_remove(&pc->chip); 653 654 654 655 clk_unprepare(pc->pwm_clk); 655 656 clk_unprepare(pc->cpt_clk); 656 657 657 - return pwmchip_remove(&pc->chip); 658 + return 0; 658 659 } 659 660 660 661 static const struct of_device_id sti_pwm_of_match[] = {