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

pwm: lpc18xx-sct: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

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
fbd2d733 ed60a877

+2 -4
+2 -4
drivers/pwm/pwm-lpc18xx-sct.c
··· 449 449 return ret; 450 450 } 451 451 452 - static int lpc18xx_pwm_remove(struct platform_device *pdev) 452 + static void lpc18xx_pwm_remove(struct platform_device *pdev) 453 453 { 454 454 struct lpc18xx_pwm_chip *lpc18xx_pwm = platform_get_drvdata(pdev); 455 455 u32 val; ··· 461 461 val | LPC18XX_PWM_CTRL_HALT); 462 462 463 463 clk_disable_unprepare(lpc18xx_pwm->pwm_clk); 464 - 465 - return 0; 466 464 } 467 465 468 466 static struct platform_driver lpc18xx_pwm_driver = { ··· 469 471 .of_match_table = lpc18xx_pwm_of_match, 470 472 }, 471 473 .probe = lpc18xx_pwm_probe, 472 - .remove = lpc18xx_pwm_remove, 474 + .remove_new = lpc18xx_pwm_remove, 473 475 }; 474 476 module_platform_driver(lpc18xx_pwm_driver); 475 477