Skip to content

Commit

Permalink
pwm: sun4i: Don't check the return code of pwmchip_remove()
Browse files Browse the repository at this point in the history
pwmchip_remove() returns always 0. Don't use the value to make it
possible to eventually change the function to return void. Also the
driver core ignores the return value of sun4i_pwm_remove()
and considers the device removed anyhow. So returning early results
in a resource leak.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
  • Loading branch information
Uwe Kleine-König authored and Thierry Reding committed Sep 2, 2021
1 parent ceb2c28 commit 7587f8a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/pwm/pwm-sun4i.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,11 +484,8 @@ static int sun4i_pwm_probe(struct platform_device *pdev)
static int sun4i_pwm_remove(struct platform_device *pdev)
{
struct sun4i_pwm_chip *pwm = platform_get_drvdata(pdev);
int ret;

ret = pwmchip_remove(&pwm->chip);
if (ret)
return ret;
pwmchip_remove(&pwm->chip);

clk_disable_unprepare(pwm->bus_clk);
reset_control_assert(pwm->rst);
Expand Down

0 comments on commit 7587f8a

Please sign in to comment.