pwm: starfive: Use pm_runtime functions to disable clock when the device being removed
authorHal Feng <hal.feng@starfivetech.com>
Wed, 30 Nov 2022 07:15:11 +0000 (15:15 +0800)
committerHal Feng <hal.feng@starfivetech.com>
Wed, 30 Nov 2022 07:15:11 +0000 (15:15 +0800)
So this can avoid disabling the pwm clock again when
the pwm device is suspended and being removed.

Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
drivers/pwm/pwm-starfive-ptc.c

index 746e6ce..0874bbb 100644 (file)
@@ -250,10 +250,9 @@ static int starfive_pwm_ptc_remove(struct platform_device *dev)
        struct starfive_pwm_ptc_device *pwm = platform_get_drvdata(dev);
        struct pwm_chip *chip = &pwm->chip;
 
-       clk_disable_unprepare(pwm->clk);
        pwmchip_remove(chip);
 
-       pm_runtime_disable(&dev->dev);
+       pm_runtime_force_suspend(&dev->dev);
 
        return 0;
 }