diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2023-07-31 11:16:26 +0200 |
---|---|---|
committer | Damien Le Moal <dlemoal@kernel.org> | 2023-08-02 10:53:16 +0200 |
commit | 3e981d936a715e368cbc8b951b3b6c985b0e2611 (patch) | |
tree | 0cbc593a182d1f88570822fb9aa9d288dc0b117a /drivers/ata/pata_ep93xx.c | |
parent | ata: pata_arasan_cf: Convert to platform remove callback returning void (diff) | |
download | linux-3e981d936a715e368cbc8b951b3b6c985b0e2611.tar.xz linux-3e981d936a715e368cbc8b951b3b6c985b0e2611.zip |
ata: pata_ep93xx: 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>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Diffstat (limited to 'drivers/ata/pata_ep93xx.c')
-rw-r--r-- | drivers/ata/pata_ep93xx.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/ata/pata_ep93xx.c b/drivers/ata/pata_ep93xx.c index c6e043e05d43..744ad5e8cfbf 100644 --- a/drivers/ata/pata_ep93xx.c +++ b/drivers/ata/pata_ep93xx.c @@ -1004,7 +1004,7 @@ err_rel_gpio: return err; } -static int ep93xx_pata_remove(struct platform_device *pdev) +static void ep93xx_pata_remove(struct platform_device *pdev) { struct ata_host *host = platform_get_drvdata(pdev); struct ep93xx_pata_data *drv_data = host->private_data; @@ -1013,7 +1013,6 @@ static int ep93xx_pata_remove(struct platform_device *pdev) ep93xx_pata_release_dma(drv_data); ep93xx_pata_clear_regs(drv_data->ide_base); ep93xx_ide_release_gpio(pdev); - return 0; } static struct platform_driver ep93xx_pata_platform_driver = { @@ -1021,7 +1020,7 @@ static struct platform_driver ep93xx_pata_platform_driver = { .name = DRV_NAME, }, .probe = ep93xx_pata_probe, - .remove = ep93xx_pata_remove, + .remove_new = ep93xx_pata_remove, }; module_platform_driver(ep93xx_pata_platform_driver); |