Skip to content

Commit 2375e96

Browse files
Uwe Kleine-Königthierryreding
authored andcommitted
pwm: sifive: Shut down hardware only after pwmchip_remove() completed
The PWMs are expected to be functional until pwmchip_remove() is called. So disable the clks only afterwards. Fixes: 9e37a53 ("pwm: sifive: Add a driver for SiFive SoC PWM") Signed-off-by: Uwe Kleine-König <[email protected]> Tested-by: Emil Renner Berthing <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent ace41d7 commit 2375e96

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/pwm/pwm-sifive.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,15 +308,16 @@ static int pwm_sifive_remove(struct platform_device *dev)
308308
struct pwm_device *pwm;
309309
int ch;
310310

311+
pwmchip_remove(&ddata->chip);
312+
clk_notifier_unregister(ddata->clk, &ddata->notifier);
313+
311314
for (ch = 0; ch < ddata->chip.npwm; ch++) {
312315
pwm = &ddata->chip.pwms[ch];
313316
if (pwm->state.enabled)
314317
clk_disable(ddata->clk);
315318
}
316319

317320
clk_unprepare(ddata->clk);
318-
pwmchip_remove(&ddata->chip);
319-
clk_notifier_unregister(ddata->clk, &ddata->notifier);
320321

321322
return 0;
322323
}

0 commit comments

Comments
 (0)