Commit d3cd3245 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by David S. Miller

net: ethernet: socionext: 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 these drivers from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e8e2c863
......@@ -2150,7 +2150,7 @@ static int netsec_probe(struct platform_device *pdev)
return ret;
}
static int netsec_remove(struct platform_device *pdev)
static void netsec_remove(struct platform_device *pdev)
{
struct netsec_priv *priv = platform_get_drvdata(pdev);
......@@ -2162,8 +2162,6 @@ static int netsec_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
free_netdev(priv->ndev);
return 0;
}
#ifdef CONFIG_PM
......@@ -2211,7 +2209,7 @@ MODULE_DEVICE_TABLE(acpi, netsec_acpi_ids);
static struct platform_driver netsec_driver = {
.probe = netsec_probe,
.remove = netsec_remove,
.remove_new = netsec_remove,
.driver = {
.name = "netsec",
.pm = &netsec_pm_ops,
......
......@@ -1719,7 +1719,7 @@ static int ave_probe(struct platform_device *pdev)
return ret;
}
static int ave_remove(struct platform_device *pdev)
static void ave_remove(struct platform_device *pdev)
{
struct net_device *ndev = platform_get_drvdata(pdev);
struct ave_private *priv = netdev_priv(ndev);
......@@ -1727,8 +1727,6 @@ static int ave_remove(struct platform_device *pdev)
unregister_netdev(ndev);
netif_napi_del(&priv->napi_rx);
netif_napi_del(&priv->napi_tx);
return 0;
}
#ifdef CONFIG_PM_SLEEP
......@@ -1976,7 +1974,7 @@ MODULE_DEVICE_TABLE(of, of_ave_match);
static struct platform_driver ave_driver = {
.probe = ave_probe,
.remove = ave_remove,
.remove_new = ave_remove,
.driver = {
.name = "ave",
.pm = AVE_PM_OPS,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment