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

net: ethernet: smsc: 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 506a327c
...@@ -2411,7 +2411,7 @@ static int smc_drv_probe(struct platform_device *pdev) ...@@ -2411,7 +2411,7 @@ static int smc_drv_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int smc_drv_remove(struct platform_device *pdev) static void smc_drv_remove(struct platform_device *pdev)
{ {
struct net_device *ndev = platform_get_drvdata(pdev); struct net_device *ndev = platform_get_drvdata(pdev);
struct smc_local *lp = netdev_priv(ndev); struct smc_local *lp = netdev_priv(ndev);
...@@ -2436,8 +2436,6 @@ static int smc_drv_remove(struct platform_device *pdev) ...@@ -2436,8 +2436,6 @@ static int smc_drv_remove(struct platform_device *pdev)
release_mem_region(res->start, SMC_IO_EXTENT); release_mem_region(res->start, SMC_IO_EXTENT);
free_netdev(ndev); free_netdev(ndev);
return 0;
} }
static int smc_drv_suspend(struct device *dev) static int smc_drv_suspend(struct device *dev)
...@@ -2480,7 +2478,7 @@ static const struct dev_pm_ops smc_drv_pm_ops = { ...@@ -2480,7 +2478,7 @@ static const struct dev_pm_ops smc_drv_pm_ops = {
static struct platform_driver smc_driver = { static struct platform_driver smc_driver = {
.probe = smc_drv_probe, .probe = smc_drv_probe,
.remove = smc_drv_remove, .remove_new = smc_drv_remove,
.driver = { .driver = {
.name = CARDNAME, .name = CARDNAME,
.pm = &smc_drv_pm_ops, .pm = &smc_drv_pm_ops,
......
...@@ -2314,7 +2314,7 @@ static int smsc911x_init(struct net_device *dev) ...@@ -2314,7 +2314,7 @@ static int smsc911x_init(struct net_device *dev)
return 0; return 0;
} }
static int smsc911x_drv_remove(struct platform_device *pdev) static void smsc911x_drv_remove(struct platform_device *pdev)
{ {
struct net_device *dev; struct net_device *dev;
struct smsc911x_data *pdata; struct smsc911x_data *pdata;
...@@ -2348,8 +2348,6 @@ static int smsc911x_drv_remove(struct platform_device *pdev) ...@@ -2348,8 +2348,6 @@ static int smsc911x_drv_remove(struct platform_device *pdev)
free_netdev(dev); free_netdev(dev);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
return 0;
} }
/* standard register acces */ /* standard register acces */
...@@ -2668,7 +2666,7 @@ MODULE_DEVICE_TABLE(acpi, smsc911x_acpi_match); ...@@ -2668,7 +2666,7 @@ MODULE_DEVICE_TABLE(acpi, smsc911x_acpi_match);
static struct platform_driver smsc911x_driver = { static struct platform_driver smsc911x_driver = {
.probe = smsc911x_drv_probe, .probe = smsc911x_drv_probe,
.remove = smsc911x_drv_remove, .remove_new = smsc911x_drv_remove,
.driver = { .driver = {
.name = SMSC_CHIPNAME, .name = SMSC_CHIPNAME,
.pm = SMSC911X_PM_OPS, .pm = SMSC911X_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