Commit 0e719e8c authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Thierry Reding
Browse files

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: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent a9ea2e79
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -650,11 +650,12 @@ static int sti_pwm_remove(struct platform_device *pdev)
{
	struct sti_pwm_chip *pc = platform_get_drvdata(pdev);

	pwmchip_remove(&pc->chip);

	clk_unprepare(pc->pwm_clk);
	clk_unprepare(pc->cpt_clk);

	return pwmchip_remove(&pc->chip);
	return 0;
}

static const struct of_device_id sti_pwm_of_match[] = {