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

net: ethernet: 8390: 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 5bed8d58
...@@ -811,7 +811,7 @@ static int ax_init_dev(struct net_device *dev) ...@@ -811,7 +811,7 @@ static int ax_init_dev(struct net_device *dev)
return ret; return ret;
} }
static int ax_remove(struct platform_device *pdev) static void ax_remove(struct platform_device *pdev)
{ {
struct net_device *dev = platform_get_drvdata(pdev); struct net_device *dev = platform_get_drvdata(pdev);
struct ei_device *ei_local = netdev_priv(dev); struct ei_device *ei_local = netdev_priv(dev);
...@@ -832,8 +832,6 @@ static int ax_remove(struct platform_device *pdev) ...@@ -832,8 +832,6 @@ static int ax_remove(struct platform_device *pdev)
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
free_netdev(dev); free_netdev(dev);
return 0;
} }
/* /*
...@@ -1011,7 +1009,7 @@ static struct platform_driver axdrv = { ...@@ -1011,7 +1009,7 @@ static struct platform_driver axdrv = {
.name = "ax88796", .name = "ax88796",
}, },
.probe = ax_probe, .probe = ax_probe,
.remove = ax_remove, .remove_new = ax_remove,
.suspend = ax_suspend, .suspend = ax_suspend,
.resume = ax_resume, .resume = ax_resume,
}; };
......
...@@ -441,7 +441,7 @@ static int mcf8390_probe(struct platform_device *pdev) ...@@ -441,7 +441,7 @@ static int mcf8390_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int mcf8390_remove(struct platform_device *pdev) static void mcf8390_remove(struct platform_device *pdev)
{ {
struct net_device *dev = platform_get_drvdata(pdev); struct net_device *dev = platform_get_drvdata(pdev);
struct resource *mem; struct resource *mem;
...@@ -450,7 +450,6 @@ static int mcf8390_remove(struct platform_device *pdev) ...@@ -450,7 +450,6 @@ static int mcf8390_remove(struct platform_device *pdev)
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
release_mem_region(mem->start, resource_size(mem)); release_mem_region(mem->start, resource_size(mem));
free_netdev(dev); free_netdev(dev);
return 0;
} }
static struct platform_driver mcf8390_drv = { static struct platform_driver mcf8390_drv = {
...@@ -458,7 +457,7 @@ static struct platform_driver mcf8390_drv = { ...@@ -458,7 +457,7 @@ static struct platform_driver mcf8390_drv = {
.name = "mcf8390", .name = "mcf8390",
}, },
.probe = mcf8390_probe, .probe = mcf8390_probe,
.remove = mcf8390_remove, .remove_new = mcf8390_remove,
}; };
module_platform_driver(mcf8390_drv); module_platform_driver(mcf8390_drv);
......
...@@ -823,7 +823,7 @@ static int __init ne_drv_probe(struct platform_device *pdev) ...@@ -823,7 +823,7 @@ static int __init ne_drv_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int ne_drv_remove(struct platform_device *pdev) static void ne_drv_remove(struct platform_device *pdev)
{ {
struct net_device *dev = platform_get_drvdata(pdev); struct net_device *dev = platform_get_drvdata(pdev);
...@@ -842,7 +842,6 @@ static int ne_drv_remove(struct platform_device *pdev) ...@@ -842,7 +842,6 @@ static int ne_drv_remove(struct platform_device *pdev)
release_region(dev->base_addr, NE_IO_EXTENT); release_region(dev->base_addr, NE_IO_EXTENT);
free_netdev(dev); free_netdev(dev);
} }
return 0;
} }
/* Remove unused devices or all if true. */ /* Remove unused devices or all if true. */
...@@ -895,7 +894,7 @@ static int ne_drv_resume(struct platform_device *pdev) ...@@ -895,7 +894,7 @@ static int ne_drv_resume(struct platform_device *pdev)
#endif #endif
static struct platform_driver ne_driver = { static struct platform_driver ne_driver = {
.remove = ne_drv_remove, .remove_new = ne_drv_remove,
.suspend = ne_drv_suspend, .suspend = ne_drv_suspend,
.resume = ne_drv_resume, .resume = ne_drv_resume,
.driver = { .driver = {
......
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