[PATCH 3/8] device: remove parameters when unregistering a device

Sascha Hauer s.hauer at pengutronix.de
Thu Feb 13 05:25:30 EST 2014


Otherwise we loose memory on each device_unregister. The ethernet
code used to do this before calling unregister_device. This can
now be removed.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/base/driver.c | 2 ++
 net/eth.c             | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index b5fe346..37560fd 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -182,6 +182,8 @@ int unregister_device(struct device_d *old_dev)
 
 	dev_dbg(old_dev, "unregister\n");
 
+	dev_remove_parameters(old_dev);
+
 	if (old_dev->driver)
 		old_dev->bus->remove(old_dev);
 
diff --git a/net/eth.c b/net/eth.c
index 37dd9e0..8c4798c 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -380,8 +380,6 @@ void eth_unregister(struct eth_device *edev)
 	if (edev == eth_current)
 		eth_current = NULL;
 
-	dev_remove_parameters(&edev->dev);
-
 	if (IS_ENABLED(CONFIG_OFDEVICE) && edev->nodepath)
 		free(edev->nodepath);
 
-- 
1.8.5.3




More information about the barebox mailing list