pwm: bcm-kona: Don't modify HW state in .remove callback
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 26 Mar 2021 08:18:04 +0000 (09:18 +0100)
committerThierry Reding <thierry.reding@gmail.com>
Fri, 9 Apr 2021 12:44:12 +0000 (14:44 +0200)
A consumer is expected to disable a PWM before calling pwm_put(). And if
they didn't there is hopefully a good reason (or the consumer needs
fixing.) Also if disabling an enabled PWM was the right thing to do, this
should better be done in the framework instead of in each low level driver.

So drop the hardware modification from the .remove() callback.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-bcm-kona.c

index f09a310428599328141cc66576699a5f46c7b671..800b9edf2e7156f7a33243b4d885d1aaf7ae0cc3 100644 (file)
@@ -310,11 +310,6 @@ static int kona_pwmc_probe(struct platform_device *pdev)
 static int kona_pwmc_remove(struct platform_device *pdev)
 {
        struct kona_pwmc *kp = platform_get_drvdata(pdev);
-       unsigned int chan;
-
-       for (chan = 0; chan < kp->chip.npwm; chan++)
-               if (pwm_is_enabled(&kp->chip.pwms[chan]))
-                       clk_disable_unprepare(kp->clk);
 
        return pwmchip_remove(&kp->chip);
 }