Skip to content

Commit 47d4708

Browse files
Uwe Kleine-Königdamien-lemoal
authored andcommitted
ata: pata_falcon: 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() will be 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> Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
1 parent 0b2771d commit 47d4708

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/ata/pata_falcon.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,18 +216,16 @@ static int pata_falcon_init_one(struct platform_device *pdev)
216216
IRQF_SHARED, &pata_falcon_sht);
217217
}
218218

219-
static int pata_falcon_remove_one(struct platform_device *pdev)
219+
static void pata_falcon_remove_one(struct platform_device *pdev)
220220
{
221221
struct ata_host *host = platform_get_drvdata(pdev);
222222

223223
ata_host_detach(host);
224-
225-
return 0;
226224
}
227225

228226
static struct platform_driver pata_falcon_driver = {
229227
.probe = pata_falcon_init_one,
230-
.remove = pata_falcon_remove_one,
228+
.remove_new = pata_falcon_remove_one,
231229
.driver = {
232230
.name = "atari-falcon-ide",
233231
},

0 commit comments

Comments
 (0)