diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2023-09-19 15:32:06 +0200 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2023-09-28 13:10:59 +0530 |
commit | c962eca73c5cce72936a8b3bd23a24b29852ea97 (patch) | |
tree | 59cab37bdb8574fed5a857f3230f4765a4bebe98 /drivers | |
parent | cc99582d46b428ba4c2cb7ecd05df4569b02d1f4 (diff) | |
download | linux-stable-c962eca73c5cce72936a8b3bd23a24b29852ea97.tar.gz linux-stable-c962eca73c5cce72936a8b3bd23a24b29852ea97.tar.bz2 linux-stable-c962eca73c5cce72936a8b3bd23a24b29852ea97.zip |
dmaengine: xilinx: xilinx_dpdma: 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-59-u.kleine-koenig@pengutronix.de
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dma/xilinx/xilinx_dpdma.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/dma/xilinx/xilinx_dpdma.c b/drivers/dma/xilinx/xilinx_dpdma.c index 84dc5240a807..69587d85a7cd 100644 --- a/drivers/dma/xilinx/xilinx_dpdma.c +++ b/drivers/dma/xilinx/xilinx_dpdma.c @@ -1736,7 +1736,7 @@ error: return ret; } -static int xilinx_dpdma_remove(struct platform_device *pdev) +static void xilinx_dpdma_remove(struct platform_device *pdev) { struct xilinx_dpdma_device *xdev = platform_get_drvdata(pdev); unsigned int i; @@ -1751,8 +1751,6 @@ static int xilinx_dpdma_remove(struct platform_device *pdev) for (i = 0; i < ARRAY_SIZE(xdev->chan); i++) xilinx_dpdma_chan_remove(xdev->chan[i]); - - return 0; } static const struct of_device_id xilinx_dpdma_of_match[] = { @@ -1763,7 +1761,7 @@ MODULE_DEVICE_TABLE(of, xilinx_dpdma_of_match); static struct platform_driver xilinx_dpdma_driver = { .probe = xilinx_dpdma_probe, - .remove = xilinx_dpdma_remove, + .remove_new = xilinx_dpdma_remove, .driver = { .name = "xilinx-zynqmp-dpdma", .of_match_table = xilinx_dpdma_of_match, |