}
mutex_unlock(&priv->mutex);
- err = register_netdev(net_dev);
+
+ err = ipw_wdev_init(net_dev);
if (err) {
- IPW_ERROR("failed to register network device\n");
+ IPW_ERROR("failed to register wireless device\n");
goto out_remove_sysfs;
}
- err = ipw_wdev_init(net_dev);
+ err = register_netdev(net_dev);
if (err) {
- IPW_ERROR("failed to register wireless device\n");
- goto out_unregister_netdev;
+ IPW_ERROR("failed to register network device\n");
+ goto out_unregister_wiphy;
}
#ifdef CONFIG_IPW2200_PROMISCUOUS
if (err) {
IPW_ERROR("Failed to register promiscuous network "
"device (error %d).\n", err);
- wiphy_unregister(priv->ieee->wdev.wiphy);
- kfree(priv->ieee->a_band.channels);
- kfree(priv->ieee->bg_band.channels);
- goto out_unregister_netdev;
+ unregister_netdev(priv->net_dev);
+ goto out_unregister_wiphy;
}
}
#endif
return 0;
- out_unregister_netdev:
- unregister_netdev(priv->net_dev);
+ out_unregister_wiphy:
+ wiphy_unregister(priv->ieee->wdev.wiphy);
+ kfree(priv->ieee->a_band.channels);
+ kfree(priv->ieee->bg_band.channels);
out_remove_sysfs:
sysfs_remove_group(&pdev->dev.kobj, &ipw_attribute_group);
out_release_irq: