diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2023-09-19 16:31:24 +0300 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2023-09-28 10:40:48 +0300 |
commit | e8da277fbb8701308cfd2337afb13d34cc233349 (patch) | |
tree | 5611381bc975f8d5d0464bf83993552f64b0162d /drivers/dma/idma64.c | |
parent | d69f80110da5d0e665d7f2872bf2185fe7f14409 (diff) | |
download | linux-e8da277fbb8701308cfd2337afb13d34cc233349.tar.xz |
dmaengine: idma64: 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-17-u.kleine-koenig@pengutronix.de
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/idma64.c')
-rw-r--r-- | drivers/dma/idma64.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/dma/idma64.c b/drivers/dma/idma64.c index 0ac634a51c5e..78a938969d7d 100644 --- a/drivers/dma/idma64.c +++ b/drivers/dma/idma64.c @@ -660,13 +660,11 @@ static int idma64_platform_probe(struct platform_device *pdev) return 0; } -static int idma64_platform_remove(struct platform_device *pdev) +static void idma64_platform_remove(struct platform_device *pdev) { struct idma64_chip *chip = platform_get_drvdata(pdev); idma64_remove(chip); - - return 0; } static int __maybe_unused idma64_pm_suspend(struct device *dev) @@ -691,7 +689,7 @@ static const struct dev_pm_ops idma64_dev_pm_ops = { static struct platform_driver idma64_platform_driver = { .probe = idma64_platform_probe, - .remove = idma64_platform_remove, + .remove_new = idma64_platform_remove, .driver = { .name = LPSS_IDMA64_DRIVER_NAME, .pm = &idma64_dev_pm_ops, |