You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
pwm: sifive: Shut down hardware only after pwmchip_remove() completed
[ Upstream commit2375e964d5] The PWMs are expected to be functional until pwmchip_remove() is called. So disable the clks only afterwards. Fixes:9e37a53eb0("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9073dbec88
commit
6aaac1d924
@@ -326,6 +326,9 @@ static int pwm_sifive_remove(struct platform_device *dev)
|
||||
struct pwm_device *pwm;
|
||||
int ch;
|
||||
|
||||
pwmchip_remove(&ddata->chip);
|
||||
clk_notifier_unregister(ddata->clk, &ddata->notifier);
|
||||
|
||||
for (ch = 0; ch < ddata->chip.npwm; ch++) {
|
||||
pwm = &ddata->chip.pwms[ch];
|
||||
if (pwm->state.enabled)
|
||||
@@ -333,8 +336,6 @@ static int pwm_sifive_remove(struct platform_device *dev)
|
||||
}
|
||||
|
||||
clk_unprepare(ddata->clk);
|
||||
pwmchip_remove(&ddata->chip);
|
||||
clk_notifier_unregister(ddata->clk, &ddata->notifier);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user