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

mmc: uniphier-sd: 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.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230727070051.17778-58-frank.li@vivo.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Yangtao Li and committed by
Ulf Hansson
8d777034 1691c261

+2 -4
+2 -4
drivers/mmc/host/uniphier-sd.c
··· 726 726 return ret; 727 727 } 728 728 729 - static int uniphier_sd_remove(struct platform_device *pdev) 729 + static void uniphier_sd_remove(struct platform_device *pdev) 730 730 { 731 731 struct tmio_mmc_host *host = platform_get_drvdata(pdev); 732 732 733 733 tmio_mmc_host_remove(host); 734 734 uniphier_sd_clk_disable(host); 735 735 tmio_mmc_host_free(host); 736 - 737 - return 0; 738 736 } 739 737 740 738 static const struct of_device_id uniphier_sd_match[] = { ··· 754 756 755 757 static struct platform_driver uniphier_sd_driver = { 756 758 .probe = uniphier_sd_probe, 757 - .remove = uniphier_sd_remove, 759 + .remove_new = uniphier_sd_remove, 758 760 .driver = { 759 761 .name = "uniphier-sd", 760 762 .probe_type = PROBE_PREFER_ASYNCHRONOUS,