Skip to content

Commit 7852eb8

Browse files
Uwe Kleine-Königkrzk
authored andcommitted
memory: ti-aemif: 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). 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/bef01091df036c82a6a6144d3aafd1d7b7be109e.1702822744.git.u.kleine-koenig@pengutronix.de Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
1 parent 622fa81 commit 7852eb8

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/memory/ti-aemif.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,17 +427,16 @@ static int aemif_probe(struct platform_device *pdev)
427427
return ret;
428428
}
429429

430-
static int aemif_remove(struct platform_device *pdev)
430+
static void aemif_remove(struct platform_device *pdev)
431431
{
432432
struct aemif_device *aemif = platform_get_drvdata(pdev);
433433

434434
clk_disable_unprepare(aemif->clk);
435-
return 0;
436435
}
437436

438437
static struct platform_driver aemif_driver = {
439438
.probe = aemif_probe,
440-
.remove = aemif_remove,
439+
.remove_new = aemif_remove,
441440
.driver = {
442441
.name = "ti-aemif",
443442
.of_match_table = of_match_ptr(aemif_of_match),

0 commit comments

Comments
 (0)