device: remove parameters when unregistering a device
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@pengutronix.de>
This commit is contained in:
parent
f0bd826abe
commit
d23af7a0a0
|
@ -182,6 +182,8 @@ int unregister_device(struct device_d *old_dev)
|
||||||
|
|
||||||
dev_dbg(old_dev, "unregister\n");
|
dev_dbg(old_dev, "unregister\n");
|
||||||
|
|
||||||
|
dev_remove_parameters(old_dev);
|
||||||
|
|
||||||
if (old_dev->driver)
|
if (old_dev->driver)
|
||||||
old_dev->bus->remove(old_dev);
|
old_dev->bus->remove(old_dev);
|
||||||
|
|
||||||
|
|
|
@ -380,8 +380,6 @@ void eth_unregister(struct eth_device *edev)
|
||||||
if (edev == eth_current)
|
if (edev == eth_current)
|
||||||
eth_current = NULL;
|
eth_current = NULL;
|
||||||
|
|
||||||
dev_remove_parameters(&edev->dev);
|
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_OFDEVICE) && edev->nodepath)
|
if (IS_ENABLED(CONFIG_OFDEVICE) && edev->nodepath)
|
||||||
free(edev->nodepath);
|
free(edev->nodepath);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue