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

mmc: usdhi60rol0: 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>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
Link: https://lore.kernel.org/r/20230727070051.17778-44-frank.li@vivo.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Yangtao Li and committed by
Ulf Hansson
7a0b007f f9b85b78

+2 -4
+2 -4
drivers/mmc/host/usdhi6rol0.c
··· 1884 1884 return ret; 1885 1885 } 1886 1886 1887 - static int usdhi6_remove(struct platform_device *pdev) 1887 + static void usdhi6_remove(struct platform_device *pdev) 1888 1888 { 1889 1889 struct usdhi6_host *host = platform_get_drvdata(pdev); 1890 1890 ··· 1895 1895 usdhi6_dma_release(host); 1896 1896 clk_disable_unprepare(host->clk); 1897 1897 mmc_free_host(host->mmc); 1898 - 1899 - return 0; 1900 1898 } 1901 1899 1902 1900 static struct platform_driver usdhi6_driver = { 1903 1901 .probe = usdhi6_probe, 1904 - .remove = usdhi6_remove, 1902 + .remove_new = usdhi6_remove, 1905 1903 .driver = { 1906 1904 .name = "usdhi6rol0", 1907 1905 .probe_type = PROBE_PREFER_ASYNCHRONOUS,