提交 da0dea89 编写于 作者: U Uwe Kleine-König 提交者: Thierry Reding

pwm: spear: Free resources only after pwmchip_remove()

Before pwmchip_remove() returns the PWM is expected to be functional. So
remove the pwmchip before disabling the clocks. The check for
pwmchip_remove()'s return value is dropped as this function returns
effectively always 0 and returning an error in a remove callback is
useless anyhow (as the device core ignores it and drops devm allocated
resources).
Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: NThierry Reding <thierry.reding@gmail.com>
上级 b601a18f
...@@ -229,9 +229,12 @@ static int spear_pwm_remove(struct platform_device *pdev) ...@@ -229,9 +229,12 @@ static int spear_pwm_remove(struct platform_device *pdev)
{ {
struct spear_pwm_chip *pc = platform_get_drvdata(pdev); struct spear_pwm_chip *pc = platform_get_drvdata(pdev);
pwmchip_remove(&pc->chip);
/* clk was prepared in probe, hence unprepare it here */ /* clk was prepared in probe, hence unprepare it here */
clk_unprepare(pc->clk); clk_unprepare(pc->clk);
return pwmchip_remove(&pc->chip);
return 0;
} }
static const struct of_device_id spear_pwm_of_match[] = { static const struct of_device_id spear_pwm_of_match[] = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册