ath6kl: remove SET_MODULE_OWNER usage
[pandora-kernel.git] / drivers / staging / ath6kl / os / linux / ar6000_drv.c
index 846eea7..bb4dbb5 100644 (file)
@@ -1573,10 +1573,6 @@ init_netdev(struct net_device *dev, char *name)
         strcpy(dev->name, name);
     }
 
-#ifdef SET_MODULE_OWNER
-    SET_MODULE_OWNER(dev);
-#endif
-
 #ifdef CONFIG_CHECKSUM_OFFLOAD
     if(csumOffload){
         dev->features |= NETIF_F_IP_CSUM; /*advertise kernel capability to do TCP/UDP CSUM offload for IPV4*/
@@ -1586,6 +1582,52 @@ init_netdev(struct net_device *dev, char *name)
     return;
 }
 
+static int __ath6kl_init_netdev(struct net_device *dev)
+{
+       int r;
+
+       rtnl_lock();
+       r = ar6000_init(dev);
+       rtnl_unlock();
+
+       if (r) {
+               AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000_avail: ar6000_init\n"));
+               return r;
+       }
+
+       return 0;
+}
+
+#ifdef HTC_RAW_INTERFACE
+static int ath6kl_init_netdev_wmi(struct net_device *dev)
+{
+       if (!eppingtest && bypasswmi)
+               return 0;
+
+       return __ath6kl_init_netdev(dev);
+}
+#else
+static int ath6kl_init_netdev_wmi(struct net_device *dev)
+{
+       return __ath6kl_init_netdev(dev);
+}
+#endif
+
+static int ath6kl_init_netdev(struct ar6_softc *ar)
+{
+       int r;
+
+        r = ar6000_sysfs_bmi_get_config(ar, wlaninitmode);
+        if (r) {
+               AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
+                               ("ar6000_avail: "
+                                "ar6000_sysfs_bmi_get_config failed\n"));
+               return r;
+        }
+
+       return ath6kl_init_netdev_wmi(ar->arNetDev);
+}
+
 /*
  * HTC Event handlers
  */
@@ -1788,26 +1830,8 @@ ar6000_avail_ev(void *context, void *hif_handle)
     AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("BMI enabled: %d\n", wlaninitmode));
     if ((wlaninitmode == WLAN_INIT_MODE_UDEV) ||
         (wlaninitmode == WLAN_INIT_MODE_DRV)) {
-        do {
-            r = ar6000_sysfs_bmi_get_config(ar, wlaninitmode);
-            if (r) {
-                AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000_avail: ar6000_sysfs_bmi_get_config failed\n"));
-                break;
-            }
-#ifdef HTC_RAW_INTERFACE
-            if (!eppingtest && bypasswmi) {
-                break; /* Don't call ar6000_init for ART */
-            }
-#endif 
-            rtnl_lock();
-            r = ar6000_init(dev);
-            rtnl_unlock();
-            if (r) {
-                AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000_avail: ar6000_init\n"));
-            }
-        } while (false);
-
-        if (r)
+       r = ath6kl_init_netdev(ar);
+       if (r)
             goto avail_ev_failed;
     }