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

pwm: imx-tpm: 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
ed60a877 f365a946

+2 -4
+2 -4
drivers/pwm/pwm-imx-tpm.c
··· 381 381 return ret; 382 382 } 383 383 384 - static int pwm_imx_tpm_remove(struct platform_device *pdev) 384 + static void pwm_imx_tpm_remove(struct platform_device *pdev) 385 385 { 386 386 struct imx_tpm_pwm_chip *tpm = platform_get_drvdata(pdev); 387 387 388 388 pwmchip_remove(&tpm->chip); 389 389 390 390 clk_disable_unprepare(tpm->clk); 391 - 392 - return 0; 393 391 } 394 392 395 393 static int __maybe_unused pwm_imx_tpm_suspend(struct device *dev) ··· 430 432 .pm = &imx_tpm_pwm_pm, 431 433 }, 432 434 .probe = pwm_imx_tpm_probe, 433 - .remove = pwm_imx_tpm_remove, 435 + .remove_new = pwm_imx_tpm_remove, 434 436 }; 435 437 module_platform_driver(imx_tpm_pwm_driver); 436 438