From: Uwe Kleine-König Date: Mon, 21 Jun 2021 13:04:58 +0000 (+0200) Subject: pwm: vt8500: Only unprepare the clock after the pwmchip was removed X-Git-Tag: v5.14-rc1~42^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=868f13bdea3304362dd882f216ba30a8bf4c10c8;p=thirdparty%2Fkernel%2Flinux.git pwm: vt8500: Only unprepare the clock after the pwmchip was removed Until pwmchip_remove() returns the PWM is supposed to work, so pwmchip_remove() must be called before the clock is stopped. The return value of pwmchip_remove doesn't need to be checked because it returns zero anyhow and I plan to make it return void soon. Signed-off-by: Uwe Kleine-König Acked-by: Arnd Bergmann Signed-off-by: Thierry Reding --- diff --git a/drivers/pwm/pwm-vt8500.c b/drivers/pwm/pwm-vt8500.c index 7164df2fbacf8..ea2aa151080a4 100644 --- a/drivers/pwm/pwm-vt8500.c +++ b/drivers/pwm/pwm-vt8500.c @@ -240,10 +240,11 @@ static int vt8500_pwm_remove(struct platform_device *pdev) { struct vt8500_chip *chip = platform_get_drvdata(pdev); + pwmchip_remove(&chip->chip); clk_unprepare(chip->clk); - return pwmchip_remove(&chip->chip); + return 0; } static struct platform_driver vt8500_pwm_driver = {