Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 9e37a53eb051 ("pwm: sifive: Add a driver for SiFive SoC PWM")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tested-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>

authored by

Uwe Kleine-König and committed by
Thierry Reding
2375e964 ace41d75

+3 -2
+3 -2
drivers/pwm/pwm-sifive.c
··· 308 308 struct pwm_device *pwm; 309 309 int ch; 310 310 311 + pwmchip_remove(&ddata->chip); 312 + clk_notifier_unregister(ddata->clk, &ddata->notifier); 313 + 311 314 for (ch = 0; ch < ddata->chip.npwm; ch++) { 312 315 pwm = &ddata->chip.pwms[ch]; 313 316 if (pwm->state.enabled) ··· 318 315 } 319 316 320 317 clk_unprepare(ddata->clk); 321 - pwmchip_remove(&ddata->chip); 322 - clk_notifier_unregister(ddata->clk, &ddata->notifier); 323 318 324 319 return 0; 325 320 }