summaryrefslogtreecommitdiffstats
path: root/net/eth.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-04-28 12:41:43 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-04-28 12:41:45 +0200
commitacd1d67ea22dd0e140bf5d085e03243053c31935 (patch)
tree944b8c90240f31be1b530144454f272a530442f9 /net/eth.c
parentefe0fa9e927a699d1d0e09ad56e8ba9eb08a61e2 (diff)
downloadbarebox-acd1d67ea22dd0e140bf5d085e03243053c31935.tar.gz
barebox-acd1d67ea22dd0e140bf5d085e03243053c31935.tar.xz
eth: halt active ethernet device on unregister
When an active ethernet device is unregistered it should be halted to quiesce the device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'net/eth.c')
-rw-r--r--net/eth.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/eth.c b/net/eth.c
index 89bddba07d..0c1ff73e4c 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -385,6 +385,9 @@ void eth_unregister(struct eth_device *edev)
if (edev == eth_current)
eth_current = NULL;
+ if (edev->active)
+ edev->halt(edev);
+
if (IS_ENABLED(CONFIG_OFDEVICE))
free(edev->nodepath);