diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2023-09-19 15:31:45 +0200 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2023-09-28 13:10:53 +0530 |
commit | d6798037fa1c01e6b9486cc1fbe1b5a272dde477 (patch) | |
tree | 2df755f16ea07bcce39e775a1389322719de575f /drivers/dma/sa11x0-dma.c | |
parent | 1a6d1c87542d6bb178db5bc2befc9abf99447684 (diff) |
dmaengine: sa11x0-dma: 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() is 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/20230919133207.1400430-38-u.kleine-koenig@pengutronix.de
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/sa11x0-dma.c')
-rw-r--r-- | drivers/dma/sa11x0-dma.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/dma/sa11x0-dma.c b/drivers/dma/sa11x0-dma.c index a29c13cae716..488408e6826a 100644 --- a/drivers/dma/sa11x0-dma.c +++ b/drivers/dma/sa11x0-dma.c @@ -984,7 +984,7 @@ static int sa11x0_dma_probe(struct platform_device *pdev) return ret; } -static int sa11x0_dma_remove(struct platform_device *pdev) +static void sa11x0_dma_remove(struct platform_device *pdev) { struct sa11x0_dma_dev *d = platform_get_drvdata(pdev); unsigned pch; @@ -997,8 +997,6 @@ static int sa11x0_dma_remove(struct platform_device *pdev) tasklet_kill(&d->task); iounmap(d->base); kfree(d); - - return 0; } static __maybe_unused int sa11x0_dma_suspend(struct device *dev) @@ -1081,7 +1079,7 @@ static struct platform_driver sa11x0_dma_driver = { .pm = &sa11x0_dma_pm_ops, }, .probe = sa11x0_dma_probe, - .remove = sa11x0_dma_remove, + .remove_new = sa11x0_dma_remove, }; static int __init sa11x0_dma_init(void) |