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

pwm: sun4i: Don't check the return code of pwmchip_remove()

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>

authored by

Uwe Kleine-König and committed by
Thierry Reding
7587f8a8 ceb2c284

+1 -4
+1 -4
drivers/pwm/pwm-sun4i.c
··· 484 484 static int sun4i_pwm_remove(struct platform_device *pdev) 485 485 { 486 486 struct sun4i_pwm_chip *pwm = platform_get_drvdata(pdev); 487 - int ret; 488 487 489 - ret = pwmchip_remove(&pwm->chip); 490 - if (ret) 491 - return ret; 488 + pwmchip_remove(&pwm->chip); 492 489 493 490 clk_disable_unprepare(pwm->bus_clk); 494 491 reset_control_assert(pwm->rst);