diff mbox series

[08/47] pwm: tiehrpwm: Unprepare clock only after the PWM was unregistered

Message ID 20210707162835.1772882-9-u.kleine-koenig@pengutronix.de
State Accepted
Headers show
Series pwm: Make pwmchip_remove return void | expand

Commit Message

Uwe Kleine-König July 7, 2021, 4:27 p.m. UTC
The driver is supposed to stay functional until pwmchip_remove()
returns. So disable clocks only after that.

pwmchip_remove() always returns 0, so the return code can be ignored
which keeps ehrpwm_pwm_remove() a bit simpler and eventually allows to
make pwmchip_remove() return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
 drivers/pwm/pwm-tiehrpwm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series


diff --git a/drivers/pwm/pwm-tiehrpwm.c b/drivers/pwm/pwm-tiehrpwm.c
index 17909fa53211..5b723a48c5f1 100644
--- a/drivers/pwm/pwm-tiehrpwm.c
+++ b/drivers/pwm/pwm-tiehrpwm.c
@@ -485,11 +485,13 @@  static int ehrpwm_pwm_remove(struct platform_device *pdev)
 	struct ehrpwm_pwm_chip *pc = platform_get_drvdata(pdev);
+	pwmchip_remove(&pc->chip);
-	return pwmchip_remove(&pc->chip);
+	return 0;