Skip to content

Commit 3e981d9

Browse files
Uwe Kleine-Königdamien-lemoal
authored andcommitted
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>
1 parent 843b62f commit 3e981d9

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/ata/pata_ep93xx.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ static int ep93xx_pata_probe(struct platform_device *pdev)
10041004
return err;
10051005
}
10061006

1007-
static int ep93xx_pata_remove(struct platform_device *pdev)
1007+
static void ep93xx_pata_remove(struct platform_device *pdev)
10081008
{
10091009
struct ata_host *host = platform_get_drvdata(pdev);
10101010
struct ep93xx_pata_data *drv_data = host->private_data;
@@ -1013,15 +1013,14 @@ static int ep93xx_pata_remove(struct platform_device *pdev)
10131013
ep93xx_pata_release_dma(drv_data);
10141014
ep93xx_pata_clear_regs(drv_data->ide_base);
10151015
ep93xx_ide_release_gpio(pdev);
1016-
return 0;
10171016
}
10181017

10191018
static struct platform_driver ep93xx_pata_platform_driver = {
10201019
.driver = {
10211020
.name = DRV_NAME,
10221021
},
10231022
.probe = ep93xx_pata_probe,
1024-
.remove = ep93xx_pata_remove,
1023+
.remove_new = ep93xx_pata_remove,
10251024
};
10261025

10271026
module_platform_driver(ep93xx_pata_platform_driver);

0 commit comments

Comments
 (0)