Skip to content

Commit 86f7fa7

Browse files
Uwe Kleine-Königthierryreding
authored andcommitted
pwm: tegra: Don't modify HW state in .remove callback
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 <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent c1b8ac9 commit 86f7fa7

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

drivers/pwm/pwm-tegra.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -300,25 +300,12 @@ static int tegra_pwm_probe(struct platform_device *pdev)
300300
static int tegra_pwm_remove(struct platform_device *pdev)
301301
{
302302
struct tegra_pwm_chip *pc = platform_get_drvdata(pdev);
303-
unsigned int i;
304303
int err;
305304

306305
err = clk_prepare_enable(pc->clk);
307306
if (err < 0)
308307
return err;
309308

310-
for (i = 0; i < pc->chip.npwm; i++) {
311-
struct pwm_device *pwm = &pc->chip.pwms[i];
312-
313-
if (!pwm_is_enabled(pwm))
314-
if (clk_prepare_enable(pc->clk) < 0)
315-
continue;
316-
317-
pwm_writel(pc, i, 0);
318-
319-
clk_disable_unprepare(pc->clk);
320-
}
321-
322309
reset_control_assert(pc->rst);
323310
clk_disable_unprepare(pc->clk);
324311

0 commit comments

Comments
 (0)