@@ -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;
@@ -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;
}