summaryrefslogtreecommitdiff
path: root/package/switch/src/switch-robo.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2008-06-15 11:10:27 +0000
committerFelix Fietkau <nbd@openwrt.org>2008-06-15 11:10:27 +0000
commit40990382e5823fc3d6a50374cfb989615e143c14 (patch)
tree99dfe44d2d4c35b2f542151d1da292f5f5c0a7f5 /package/switch/src/switch-robo.c
parent9621d872ca496eadb79399d0351abf96abc35338 (diff)
downloadmtk-20170518-40990382e5823fc3d6a50374cfb989615e143c14.zip
mtk-20170518-40990382e5823fc3d6a50374cfb989615e143c14.tar.gz
mtk-20170518-40990382e5823fc3d6a50374cfb989615e143c14.tar.bz2
(4/6) bcm57xx: switch-core.c/switch-robo.c check for port already registered
This patch prevents switch-robo.c from attempting robo_probe on a port that is already registered. robo_probe will adjust kernel reference counts if it detects a switch on the port. If this patch wasn't applied, the wrt350n would hang on reboot, waiting for the network driver reference count to reach zero indefinitely. Signed-off-by: Ben Pfountz <netprince (at) vt (dot) edu> SVN-Revision: 11469
Diffstat (limited to 'package/switch/src/switch-robo.c')
-rw-r--r--package/switch/src/switch-robo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/package/switch/src/switch-robo.c b/package/switch/src/switch-robo.c
index 045dce1..779b89f 100644
--- a/package/switch/src/switch-robo.c
+++ b/package/switch/src/switch-robo.c
@@ -528,7 +528,8 @@ static int __init robo_init(void)
device = strdup("ethX");
for (device[3] = '0'; (device[3] <= '3') && notfound; device[3]++) {
- notfound = robo_probe(device);
+ if (! switch_device_registered (device))
+ notfound = robo_probe(device);
}
device[3]--;