Skip to content

Commit 114dda8

Browse files
Uwe Kleine-Königdamien-lemoal
authored andcommitted
ata: sata_gemini: 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> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
1 parent 1a9bc02 commit 114dda8

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/ata/sata_gemini.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ static int gemini_sata_probe(struct platform_device *pdev)
399399
return ret;
400400
}
401401

402-
static int gemini_sata_remove(struct platform_device *pdev)
402+
static void gemini_sata_remove(struct platform_device *pdev)
403403
{
404404
struct sata_gemini *sg = platform_get_drvdata(pdev);
405405

@@ -408,8 +408,6 @@ static int gemini_sata_remove(struct platform_device *pdev)
408408
clk_unprepare(sg->sata0_pclk);
409409
}
410410
sg_singleton = NULL;
411-
412-
return 0;
413411
}
414412

415413
static const struct of_device_id gemini_sata_of_match[] = {
@@ -423,7 +421,7 @@ static struct platform_driver gemini_sata_driver = {
423421
.of_match_table = gemini_sata_of_match,
424422
},
425423
.probe = gemini_sata_probe,
426-
.remove = gemini_sata_remove,
424+
.remove_new = gemini_sata_remove,
427425
};
428426
module_platform_driver(gemini_sata_driver);
429427

0 commit comments

Comments
 (0)