diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2006-05-10 16:21:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-05-10 16:21:53 -0400 |
commit | ac05202e8b83594bf6797d241371e6c752f371e6 (patch) | |
tree | 4e75d1f6b14b6b0d3700a00f964a7eaadd04b8f9 /net | |
parent | b17a7c179dd3ce7d04373fddf660eda21efc9db9 (diff) |
[BRIDGE]: Do sysfs registration inside rtnl.
Now that netdevice sysfs registration is done as part of
register_netdevice; bridge code no longer has to be tricky when adding
it's kobjects to bridges.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/bridge/br_if.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 59eef42d4a42..ad1c7af65ec8 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
@@ -308,26 +308,19 @@ int br_add_bridge(const char *name) | |||
308 | if (ret) | 308 | if (ret) |
309 | goto err2; | 309 | goto err2; |
310 | 310 | ||
311 | /* network device kobject is not setup until | ||
312 | * after rtnl_unlock does it's hotplug magic. | ||
313 | * so hold reference to avoid race. | ||
314 | */ | ||
315 | dev_hold(dev); | ||
316 | rtnl_unlock(); | ||
317 | |||
318 | ret = br_sysfs_addbr(dev); | 311 | ret = br_sysfs_addbr(dev); |
319 | dev_put(dev); | 312 | if (ret) |
320 | 313 | goto err3; | |
321 | if (ret) | 314 | rtnl_unlock(); |
322 | unregister_netdev(dev); | 315 | return 0; |
323 | out: | ||
324 | return ret; | ||
325 | 316 | ||
317 | err3: | ||
318 | unregister_netdev(dev); | ||
326 | err2: | 319 | err2: |
327 | free_netdev(dev); | 320 | free_netdev(dev); |
328 | err1: | 321 | err1: |
329 | rtnl_unlock(); | 322 | rtnl_unlock(); |
330 | goto out; | 323 | return ret; |
331 | } | 324 | } |
332 | 325 | ||
333 | int br_del_bridge(const char *name) | 326 | int br_del_bridge(const char *name) |