summaryrefslogtreecommitdiffstats
path: root/drivers/dma/at_hdmac.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-09-19 15:31:11 +0200
committerVinod Koul <vkoul@kernel.org>2023-09-28 13:10:45 +0530
commitae3f38e495b42494414cbace3b3bd3cb6dc10506 (patch)
treeb0e12a38dca2013896c8912bc4bf7c8418cfed0f /drivers/dma/at_hdmac.c
parente7d5aa30c8a19e6d9c4ec19d3b9e501df22e1d1a (diff)
downloadlinux-stable-ae3f38e495b42494414cbace3b3bd3cb6dc10506.tar.gz
linux-stable-ae3f38e495b42494414cbace3b3bd3cb6dc10506.tar.bz2
linux-stable-ae3f38e495b42494414cbace3b3bd3cb6dc10506.zip
dmaengine: at_hdmac: 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-4-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/at_hdmac.c')
-rw-r--r--drivers/dma/at_hdmac.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index b2876f67471f..417a9428a9b6 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -2100,7 +2100,7 @@ err_irq:
return err;
}
-static int at_dma_remove(struct platform_device *pdev)
+static void at_dma_remove(struct platform_device *pdev)
{
struct at_dma *atdma = platform_get_drvdata(pdev);
struct dma_chan *chan, *_chan;
@@ -2122,8 +2122,6 @@ static int at_dma_remove(struct platform_device *pdev)
}
clk_disable_unprepare(atdma->clk);
-
- return 0;
}
static void at_dma_shutdown(struct platform_device *pdev)
@@ -2242,7 +2240,7 @@ static const struct dev_pm_ops __maybe_unused at_dma_dev_pm_ops = {
};
static struct platform_driver at_dma_driver = {
- .remove = at_dma_remove,
+ .remove_new = at_dma_remove,
.shutdown = at_dma_shutdown,
.id_table = atdma_devtypes,
.driver = {