Skip to content

Commit 2010259

Browse files
Uwe Kleine-Königdamien-lemoal
authored andcommitted
ata: pata_ftide010: 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 3e981d9 commit 2010259

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/ata/pata_ftide010.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,15 +536,13 @@ static int pata_ftide010_probe(struct platform_device *pdev)
536536
return ret;
537537
}
538538

539-
static int pata_ftide010_remove(struct platform_device *pdev)
539+
static void pata_ftide010_remove(struct platform_device *pdev)
540540
{
541541
struct ata_host *host = platform_get_drvdata(pdev);
542542
struct ftide010 *ftide = host->private_data;
543543

544544
ata_host_detach(ftide->host);
545545
clk_disable_unprepare(ftide->pclk);
546-
547-
return 0;
548546
}
549547

550548
static const struct of_device_id pata_ftide010_of_match[] = {
@@ -558,7 +556,7 @@ static struct platform_driver pata_ftide010_driver = {
558556
.of_match_table = pata_ftide010_of_match,
559557
},
560558
.probe = pata_ftide010_probe,
561-
.remove = pata_ftide010_remove,
559+
.remove_new = pata_ftide010_remove,
562560
};
563561
module_platform_driver(pata_ftide010_driver);
564562

0 commit comments

Comments
 (0)