Skip to content

Commit 009b384

Browse files
Uwe Kleine-Königgregkh
authored andcommitted
pwm: sifive: Shut down hardware only after pwmchip_remove() completed
[ Upstream commit 2375e96 ] 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]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 53d7848 commit 009b384

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
@@ -321,15 +321,16 @@ static int pwm_sifive_remove(struct platform_device *dev)
321321
struct pwm_device *pwm;
322322
int ch;
323323

324+
pwmchip_remove(&ddata->chip);
325+
clk_notifier_unregister(ddata->clk, &ddata->notifier);
326+
324327
for (ch = 0; ch < ddata->chip.npwm; ch++) {
325328
pwm = &ddata->chip.pwms[ch];
326329
if (pwm->state.enabled)
327330
clk_disable(ddata->clk);
328331
}
329332

330333
clk_unprepare(ddata->clk);
331-
pwmchip_remove(&ddata->chip);
332-
clk_notifier_unregister(ddata->clk, &ddata->notifier);
333334

334335
return 0;
335336
}

0 commit comments

Comments
 (0)