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

pwm: hibvt: Disable the clock only after the PWM was unregistered

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>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>

authored by

Uwe Kleine-König and committed by
Thierry Reding
04d77521 d44084c9

+3 -1
+3 -1
drivers/pwm/pwm-hibvt.c
··· 248 248 249 249 pwm_chip = platform_get_drvdata(pdev); 250 250 251 + pwmchip_remove(&pwm_chip->chip); 252 + 251 253 reset_control_assert(pwm_chip->rstc); 252 254 msleep(30); 253 255 reset_control_deassert(pwm_chip->rstc); 254 256 255 257 clk_disable_unprepare(pwm_chip->clk); 256 258 257 - return pwmchip_remove(&pwm_chip->chip); 259 + return 0; 258 260 } 259 261 260 262 static const struct of_device_id hibvt_pwm_of_match[] = {