From: Uwe Kleine-König Date: Tue, 19 Sep 2023 13:31:11 +0000 (+0200) Subject: dmaengine: at_hdmac: Convert to platform remove callback returning void X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ae3f38e495b42494414cbace3b3bd3cb6dc10506;p=users%2Fjedix%2Flinux-maple.git 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 Link: https://lore.kernel.org/r/20230919133207.1400430-4-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul --- 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 = {