Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Uwe Kleine-König and committed by
Damien Le Moal
1a9bc02b ac1bc5f9

+2 -4
+2 -4
drivers/ata/sata_fsl.c
··· 1526 1526 return retval; 1527 1527 } 1528 1528 1529 - static int sata_fsl_remove(struct platform_device *ofdev) 1529 + static void sata_fsl_remove(struct platform_device *ofdev) 1530 1530 { 1531 1531 struct ata_host *host = platform_get_drvdata(ofdev); 1532 1532 struct sata_fsl_host_priv *host_priv = host->private_data; ··· 1535 1535 device_remove_file(&ofdev->dev, &host_priv->rx_watermark); 1536 1536 1537 1537 ata_host_detach(host); 1538 - 1539 - return 0; 1540 1538 } 1541 1539 1542 1540 #ifdef CONFIG_PM_SLEEP ··· 1589 1591 .of_match_table = fsl_sata_match, 1590 1592 }, 1591 1593 .probe = sata_fsl_probe, 1592 - .remove = sata_fsl_remove, 1594 + .remove_new = sata_fsl_remove, 1593 1595 #ifdef CONFIG_PM_SLEEP 1594 1596 .suspend = sata_fsl_suspend, 1595 1597 .resume = sata_fsl_resume,