Skip to content

Commit caea958

Browse files
Uwe Kleine-Königdamien-lemoal
authored andcommitted
ata: sata_rcar: 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 3596b02 commit caea958

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/ata/sata_rcar.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ static int sata_rcar_probe(struct platform_device *pdev)
909909
return ret;
910910
}
911911

912-
static int sata_rcar_remove(struct platform_device *pdev)
912+
static void sata_rcar_remove(struct platform_device *pdev)
913913
{
914914
struct ata_host *host = platform_get_drvdata(pdev);
915915
struct sata_rcar_priv *priv = host->private_data;
@@ -925,8 +925,6 @@ static int sata_rcar_remove(struct platform_device *pdev)
925925

926926
pm_runtime_put(&pdev->dev);
927927
pm_runtime_disable(&pdev->dev);
928-
929-
return 0;
930928
}
931929

932930
#ifdef CONFIG_PM_SLEEP
@@ -1011,7 +1009,7 @@ static const struct dev_pm_ops sata_rcar_pm_ops = {
10111009

10121010
static struct platform_driver sata_rcar_driver = {
10131011
.probe = sata_rcar_probe,
1014-
.remove = sata_rcar_remove,
1012+
.remove_new = sata_rcar_remove,
10151013
.driver = {
10161014
.name = DRV_NAME,
10171015
.of_match_table = sata_rcar_match,

0 commit comments

Comments
 (0)