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

spi: slave-mt27xx: 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>
Link: https://lore.kernel.org/r/20230303172041.2103336-69-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Uwe Kleine-König and committed by
Mark Brown
1037cfa3 fd8998c4

+2 -4
+2 -4
drivers/spi/spi-slave-mt27xx.c
··· 474 474 return ret; 475 475 } 476 476 477 - static int mtk_spi_slave_remove(struct platform_device *pdev) 477 + static void mtk_spi_slave_remove(struct platform_device *pdev) 478 478 { 479 479 pm_runtime_disable(&pdev->dev); 480 - 481 - return 0; 482 480 } 483 481 484 482 #ifdef CONFIG_PM_SLEEP ··· 558 560 .of_match_table = mtk_spi_slave_of_match, 559 561 }, 560 562 .probe = mtk_spi_slave_probe, 561 - .remove = mtk_spi_slave_remove, 563 + .remove_new = mtk_spi_slave_remove, 562 564 }; 563 565 564 566 module_platform_driver(mtk_spi_slave_driver);