aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ipw2x00
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2012-01-21 22:11:12 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-05-08 21:53:47 -0400
commite19d8baf8cfcc0b96d7578a22801d16400d877bd (patch)
treeb22abe74bd86c1c71c950902f810661254c1167f /drivers/net/wireless/ipw2x00
parentb4050790d0a6bfec76e2186d461123cf9586aa34 (diff)
ipw2100: Fix order of device registration
Currently cfg80211 fails to create a "phy80211" symlink in sysfs from the net device to the wiphy device. The latter needs to be registered first. Compile-tested only. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ipw2x00')
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2100.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index c72136c0777..9cfae0c0870 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -1963,10 +1963,8 @@ static int ipw2100_wdev_init(struct net_device *dev)
1963 wdev->wiphy->n_cipher_suites = ARRAY_SIZE(ipw_cipher_suites); 1963 wdev->wiphy->n_cipher_suites = ARRAY_SIZE(ipw_cipher_suites);
1964 1964
1965 set_wiphy_dev(wdev->wiphy, &priv->pci_dev->dev); 1965 set_wiphy_dev(wdev->wiphy, &priv->pci_dev->dev);
1966 if (wiphy_register(wdev->wiphy)) { 1966 if (wiphy_register(wdev->wiphy))
1967 ipw2100_down(priv);
1968 return -EIO; 1967 return -EIO;
1969 }
1970 return 0; 1968 return 0;
1971} 1969}
1972 1970
@@ -6331,6 +6329,11 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
6331 printk(KERN_INFO DRV_NAME 6329 printk(KERN_INFO DRV_NAME
6332 ": Detected Intel PRO/Wireless 2100 Network Connection\n"); 6330 ": Detected Intel PRO/Wireless 2100 Network Connection\n");
6333 6331
6332 err = ipw2100_wdev_init(dev);
6333 if (err)
6334 goto fail;
6335 registered = 1;
6336
6334 /* Bring up the interface. Pre 0.46, after we registered the 6337 /* Bring up the interface. Pre 0.46, after we registered the
6335 * network device we would call ipw2100_up. This introduced a race 6338 * network device we would call ipw2100_up. This introduced a race
6336 * condition with newer hotplug configurations (network was coming 6339 * condition with newer hotplug configurations (network was coming
@@ -6347,11 +6350,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
6347 "Error calling register_netdev.\n"); 6350 "Error calling register_netdev.\n");
6348 goto fail; 6351 goto fail;
6349 } 6352 }
6350 registered = 1; 6353 registered = 2;
6351
6352 err = ipw2100_wdev_init(dev);
6353 if (err)
6354 goto fail;
6355 6354
6356 mutex_lock(&priv->action_mutex); 6355 mutex_lock(&priv->action_mutex);
6357 6356
@@ -6390,13 +6389,16 @@ out:
6390 6389
6391 fail_unlock: 6390 fail_unlock:
6392 mutex_unlock(&priv->action_mutex); 6391 mutex_unlock(&priv->action_mutex);
6393 wiphy_unregister(priv->ieee->wdev.wiphy);
6394 kfree(priv->ieee->bg_band.channels);
6395 fail: 6392 fail:
6396 if (dev) { 6393 if (dev) {
6397 if (registered) 6394 if (registered >= 2)
6398 unregister_netdev(dev); 6395 unregister_netdev(dev);
6399 6396
6397 if (registered) {
6398 wiphy_unregister(priv->ieee->wdev.wiphy);
6399 kfree(priv->ieee->bg_band.channels);
6400 }
6401
6400 ipw2100_hw_stop_adapter(priv); 6402 ipw2100_hw_stop_adapter(priv);
6401 6403
6402 ipw2100_disable_interrupts(priv); 6404 ipw2100_disable_interrupts(priv);