diff options
Diffstat (limited to 'drivers/net/wireless/ipw2x00/ipw2200.c')
-rw-r--r-- | drivers/net/wireless/ipw2x00/ipw2200.c | 44 |
1 files changed, 18 insertions, 26 deletions
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c index b3707dadad1..0036737fe8e 100644 --- a/drivers/net/wireless/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/ipw2x00/ipw2200.c | |||
@@ -11443,20 +11443,6 @@ static void ipw_bg_down(struct work_struct *work) | |||
11443 | mutex_unlock(&priv->mutex); | 11443 | mutex_unlock(&priv->mutex); |
11444 | } | 11444 | } |
11445 | 11445 | ||
11446 | /* Called by register_netdev() */ | ||
11447 | static int ipw_net_init(struct net_device *dev) | ||
11448 | { | ||
11449 | int rc = 0; | ||
11450 | struct ipw_priv *priv = libipw_priv(dev); | ||
11451 | |||
11452 | mutex_lock(&priv->mutex); | ||
11453 | if (ipw_up(priv)) | ||
11454 | rc = -EIO; | ||
11455 | mutex_unlock(&priv->mutex); | ||
11456 | |||
11457 | return rc; | ||
11458 | } | ||
11459 | |||
11460 | static int ipw_wdev_init(struct net_device *dev) | 11446 | static int ipw_wdev_init(struct net_device *dev) |
11461 | { | 11447 | { |
11462 | int i, rc = 0; | 11448 | int i, rc = 0; |
@@ -11725,7 +11711,6 @@ static void ipw_prom_free(struct ipw_priv *priv) | |||
11725 | #endif | 11711 | #endif |
11726 | 11712 | ||
11727 | static const struct net_device_ops ipw_netdev_ops = { | 11713 | static const struct net_device_ops ipw_netdev_ops = { |
11728 | .ndo_init = ipw_net_init, | ||
11729 | .ndo_open = ipw_net_open, | 11714 | .ndo_open = ipw_net_open, |
11730 | .ndo_stop = ipw_net_stop, | 11715 | .ndo_stop = ipw_net_stop, |
11731 | .ndo_set_rx_mode = ipw_net_set_multicast_list, | 11716 | .ndo_set_rx_mode = ipw_net_set_multicast_list, |
@@ -11848,17 +11833,24 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev, | |||
11848 | goto out_release_irq; | 11833 | goto out_release_irq; |
11849 | } | 11834 | } |
11850 | 11835 | ||
11851 | mutex_unlock(&priv->mutex); | 11836 | if (ipw_up(priv)) { |
11852 | err = register_netdev(net_dev); | 11837 | mutex_unlock(&priv->mutex); |
11853 | if (err) { | 11838 | err = -EIO; |
11854 | IPW_ERROR("failed to register network device\n"); | ||
11855 | goto out_remove_sysfs; | 11839 | goto out_remove_sysfs; |
11856 | } | 11840 | } |
11857 | 11841 | ||
11842 | mutex_unlock(&priv->mutex); | ||
11843 | |||
11858 | err = ipw_wdev_init(net_dev); | 11844 | err = ipw_wdev_init(net_dev); |
11859 | if (err) { | 11845 | if (err) { |
11860 | IPW_ERROR("failed to register wireless device\n"); | 11846 | IPW_ERROR("failed to register wireless device\n"); |
11861 | goto out_unregister_netdev; | 11847 | goto out_remove_sysfs; |
11848 | } | ||
11849 | |||
11850 | err = register_netdev(net_dev); | ||
11851 | if (err) { | ||
11852 | IPW_ERROR("failed to register network device\n"); | ||
11853 | goto out_unregister_wiphy; | ||
11862 | } | 11854 | } |
11863 | 11855 | ||
11864 | #ifdef CONFIG_IPW2200_PROMISCUOUS | 11856 | #ifdef CONFIG_IPW2200_PROMISCUOUS |
@@ -11867,10 +11859,8 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev, | |||
11867 | if (err) { | 11859 | if (err) { |
11868 | IPW_ERROR("Failed to register promiscuous network " | 11860 | IPW_ERROR("Failed to register promiscuous network " |
11869 | "device (error %d).\n", err); | 11861 | "device (error %d).\n", err); |
11870 | wiphy_unregister(priv->ieee->wdev.wiphy); | 11862 | unregister_netdev(priv->net_dev); |
11871 | kfree(priv->ieee->a_band.channels); | 11863 | goto out_unregister_wiphy; |
11872 | kfree(priv->ieee->bg_band.channels); | ||
11873 | goto out_unregister_netdev; | ||
11874 | } | 11864 | } |
11875 | } | 11865 | } |
11876 | #endif | 11866 | #endif |
@@ -11882,8 +11872,10 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev, | |||
11882 | 11872 | ||
11883 | return 0; | 11873 | return 0; |
11884 | 11874 | ||
11885 | out_unregister_netdev: | 11875 | out_unregister_wiphy: |
11886 | unregister_netdev(priv->net_dev); | 11876 | wiphy_unregister(priv->ieee->wdev.wiphy); |
11877 | kfree(priv->ieee->a_band.channels); | ||
11878 | kfree(priv->ieee->bg_band.channels); | ||
11887 | out_remove_sysfs: | 11879 | out_remove_sysfs: |
11888 | sysfs_remove_group(&pdev->dev.kobj, &ipw_attribute_group); | 11880 | sysfs_remove_group(&pdev->dev.kobj, &ipw_attribute_group); |
11889 | out_release_irq: | 11881 | out_release_irq: |