[PATCH 4/5] eth: halt active ethernet device on unregister

Sascha Hauer s.hauer at pengutronix.de
Tue Apr 28 04:05:36 PDT 2015


When an active ethernet device is unregistered it should
be halted to quiesce the device.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 net/eth.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/eth.c b/net/eth.c
index 89bddba..0c1ff73 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);
 
-- 
2.1.4




More information about the barebox mailing list