diff mbox

ath6kl: fix device registration ordering

Message ID 1300416312-16808-1-git-send-email-lrodriguez@atheros.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Luis Rodriguez March 18, 2011, 2:45 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/staging/ath6kl/os/linux/ar6000_drv.c b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
index 6ca147f..67e89c4 100644
--- a/drivers/staging/ath6kl/os/linux/ar6000_drv.c
+++ b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
@@ -1842,11 +1842,19 @@  ar6000_avail_ev(void *context, void *hif_handle)
                     dev->name, (unsigned long)ar->arHifDevice, (unsigned long)dev, device_index,
                     (unsigned long)ar));
 
+#ifdef ATH6K_CONFIG_CFG80211
+	init_status = wiphy_register(wdev->wiphy);
+#endif
+
 avail_ev_failed :
     if (init_status) {
         if (bmienable) { 
             ar6000_sysfs_bmi_deinit(ar);  
         }
+#ifdef ATH6K_CONFIG_CFG80211
+        ar6k_cfg80211_deinit(ar);
+#endif
+
     }
 
     return init_status;
diff --git a/drivers/staging/ath6kl/os/linux/cfg80211.c b/drivers/staging/ath6kl/os/linux/cfg80211.c
index 1f799c1..17a572a 100644
--- a/drivers/staging/ath6kl/os/linux/cfg80211.c
+++ b/drivers/staging/ath6kl/os/linux/cfg80211.c
@@ -1416,7 +1416,6 @@  cfg80211_ops ar6k_cfg80211_ops = {
 struct wireless_dev *
 ar6k_cfg80211_init(struct device *dev)
 {
-    int ret = 0;
     struct wireless_dev *wdev;
 
     AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: \n", __func__));
@@ -1451,14 +1450,6 @@  ar6k_cfg80211_init(struct device *dev)
     wdev->wiphy->cipher_suites = cipher_suites;
     wdev->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites);
 
-    ret = wiphy_register(wdev->wiphy);
-    if(ret < 0) {
-        AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
-                        ("%s: Couldn't register wiphy device\n", __func__));
-        wiphy_free(wdev->wiphy);
-        return ERR_PTR(ret);
-    }
-
     return wdev;
 }