Skip to content

Commit 1a9bc02

Browse files
Uwe Kleine-Königdamien-lemoal
authored andcommitted
ata: sata_fsl: 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 ac1bc5f commit 1a9bc02

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/ata/sata_fsl.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,7 +1526,7 @@ static int sata_fsl_probe(struct platform_device *ofdev)
15261526
return retval;
15271527
}
15281528

1529-
static int sata_fsl_remove(struct platform_device *ofdev)
1529+
static void sata_fsl_remove(struct platform_device *ofdev)
15301530
{
15311531
struct ata_host *host = platform_get_drvdata(ofdev);
15321532
struct sata_fsl_host_priv *host_priv = host->private_data;
@@ -1535,8 +1535,6 @@ static int sata_fsl_remove(struct platform_device *ofdev)
15351535
device_remove_file(&ofdev->dev, &host_priv->rx_watermark);
15361536

15371537
ata_host_detach(host);
1538-
1539-
return 0;
15401538
}
15411539

15421540
#ifdef CONFIG_PM_SLEEP
@@ -1591,7 +1589,7 @@ static struct platform_driver fsl_sata_driver = {
15911589
.of_match_table = fsl_sata_match,
15921590
},
15931591
.probe = sata_fsl_probe,
1594-
.remove = sata_fsl_remove,
1592+
.remove_new = sata_fsl_remove,
15951593
#ifdef CONFIG_PM_SLEEP
15961594
.suspend = sata_fsl_suspend,
15971595
.resume = sata_fsl_resume,

0 commit comments

Comments
 (0)