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

mmc: sdhci: milbeaut: 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: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20230727070051.17778-10-frank.li@vivo.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Yangtao Li and committed by
Ulf Hansson
9479a631 603b7275

+2 -4
+2 -4
drivers/mmc/host/sdhci-milbeaut.c
··· 313 313 return ret; 314 314 } 315 315 316 - static int sdhci_milbeaut_remove(struct platform_device *pdev) 316 + static void sdhci_milbeaut_remove(struct platform_device *pdev) 317 317 { 318 318 struct sdhci_host *host = platform_get_drvdata(pdev); 319 319 struct f_sdhost_priv *priv = sdhci_priv(host); ··· 326 326 327 327 sdhci_free_host(host); 328 328 platform_set_drvdata(pdev, NULL); 329 - 330 - return 0; 331 329 } 332 330 333 331 static struct platform_driver sdhci_milbeaut_driver = { ··· 335 337 .of_match_table = mlb_dt_ids, 336 338 }, 337 339 .probe = sdhci_milbeaut_probe, 338 - .remove = sdhci_milbeaut_remove, 340 + .remove_new = sdhci_milbeaut_remove, 339 341 }; 340 342 341 343 module_platform_driver(sdhci_milbeaut_driver);