diff mbox series

[06/47] pwm: hibvt: Disable the clock only after the PWM was unregistered

Message ID 20210707162835.1772882-7-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 and reset the hardware only after that.

The return value of pwmchip_remove doesn't need to be checked because
it returns zero anyhow and should be changed to return void eventually.

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


diff --git a/drivers/pwm/pwm-hibvt.c b/drivers/pwm/pwm-hibvt.c
index 4a6e9ad3c0ff..333f1b18ff4e 100644
--- a/drivers/pwm/pwm-hibvt.c
+++ b/drivers/pwm/pwm-hibvt.c
@@ -248,13 +248,15 @@  static int hibvt_pwm_remove(struct platform_device *pdev)
 	pwm_chip = platform_get_drvdata(pdev);
+	pwmchip_remove(&pwm_chip->chip);
-	return pwmchip_remove(&pwm_chip->chip);
+	return 0;
 static const struct of_device_id hibvt_pwm_of_match[] = {