Skip to content

Commit 423e548

Browse files
Uwe Kleine-Königbroonie
authored andcommitted
spi: imx: 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/20230306065733.2170662-3-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 11951c9 commit 423e548

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/spi/spi-imx.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1848,7 +1848,7 @@ static int spi_imx_probe(struct platform_device *pdev)
18481848
return ret;
18491849
}
18501850

1851-
static int spi_imx_remove(struct platform_device *pdev)
1851+
static void spi_imx_remove(struct platform_device *pdev)
18521852
{
18531853
struct spi_controller *controller = platform_get_drvdata(pdev);
18541854
struct spi_imx_data *spi_imx = spi_controller_get_devdata(controller);
@@ -1867,8 +1867,6 @@ static int spi_imx_remove(struct platform_device *pdev)
18671867
pm_runtime_disable(spi_imx->dev);
18681868

18691869
spi_imx_sdma_exit(spi_imx);
1870-
1871-
return 0;
18721870
}
18731871

18741872
static int __maybe_unused spi_imx_runtime_resume(struct device *dev)
@@ -1930,7 +1928,7 @@ static struct platform_driver spi_imx_driver = {
19301928
.pm = &imx_spi_pm,
19311929
},
19321930
.probe = spi_imx_probe,
1933-
.remove = spi_imx_remove,
1931+
.remove_new = spi_imx_remove,
19341932
};
19351933
module_platform_driver(spi_imx_driver);
19361934

0 commit comments

Comments
 (0)