summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorRichard Zhao <richard.zhao@freescale.com>2010-03-23 11:34:40 +0800
committerRichard Zhao <richard.zhao@freescale.com>2010-03-24 13:18:16 +0800
commit2228ca928df6d7aa061bf7641e702a2f1da77419 (patch)
tree5ddc102b3afd3ec98fac6d1ab23106f6664ed34a /net
parent1bc3d9cd0ef1706e22c9bf6eddb36f435b426938 (diff)
ENGR00121869 net: register_netdevice call netdev_register_kobject at end
fix connman can not detect wlan device dynamically. Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 6a94475aee85..f956b9cbe963 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4783,12 +4783,6 @@ int register_netdevice(struct net_device *dev)
if (dev->features & NETIF_F_SG)
dev->features |= NETIF_F_GSO;
- netdev_initialize_kobject(dev);
- ret = netdev_register_kobject(dev);
- if (ret)
- goto err_uninit;
- dev->reg_state = NETREG_REGISTERED;
-
/*
* Default initial state at registry is that the
* device is present.
@@ -4800,6 +4794,12 @@ int register_netdevice(struct net_device *dev)
dev_hold(dev);
list_netdevice(dev);
+ netdev_initialize_kobject(dev);
+ ret = netdev_register_kobject(dev);
+ if (ret)
+ goto err_uninit;
+ dev->reg_state = NETREG_REGISTERED;
+
/* Notify protocols, that a new device appeared. */
ret = call_netdevice_notifiers(NETDEV_REGISTER, dev);
ret = notifier_to_errno(ret);