diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-02-14 22:55:48 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-02-14 23:57:07 +0100 |
commit | f3d0cb7f7323a0e7c81cb1acaa459bd52c4846dc (patch) | |
tree | a59edbd1c391b9593d68f5be8f01375447526945 /net | |
parent | 4af196ebfce40749cef85ad2fb4bc37e4285dfa9 (diff) | |
download | barebox-f3d0cb7f7323a0e7c81cb1acaa459bd52c4846dc.tar.gz barebox-f3d0cb7f7323a0e7c81cb1acaa459bd52c4846dc.tar.xz |
net: fix eth device unregistration
We register a device in eth_register, thus we have to unregister it in
eth_unregister. Also, if the device we unregister is the current device,
we have to set the current eth_device to NULL so that it isn't used anymore.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'net')
-rw-r--r-- | net/eth.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -244,8 +244,11 @@ int eth_register(struct eth_device *edev) void eth_unregister(struct eth_device *edev) { - dev_remove_parameters(&edev->dev); + if (edev == eth_current) + eth_current = NULL; + dev_remove_parameters(&edev->dev); + unregister_device(&edev->dev); list_del(&edev->list); } |