These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / staging / rtl8712 / os_intfs.c
index 6e776e5..b89e2d3 100644 (file)
@@ -97,7 +97,7 @@ static char *initmac;
  */
 static int wifi_test;
 
-module_param_string(ifname, ifname, sizeof(ifname), S_IRUGO|S_IWUSR);
+module_param_string(ifname, ifname, sizeof(ifname), S_IRUGO | S_IWUSR);
 module_param(wifi_test, int, 0644);
 module_param(initmac, charp, 0644);
 module_param(video_mode, int, 0644);
@@ -122,13 +122,11 @@ module_param(low_power, int, 0644);
 MODULE_PARM_DESC(ifname, " Net interface name, wlan%d=default");
 MODULE_PARM_DESC(initmac, "MAC-Address, default: use FUSE");
 
-static uint loadparam(struct _adapter *padapter, struct  net_device *pnetdev);
 static int netdev_open(struct net_device *pnetdev);
 static int netdev_close(struct net_device *pnetdev);
 
-static uint loadparam(struct _adapter *padapter, struct  net_device *pnetdev)
+static void loadparam(struct _adapter *padapter, struct  net_device *pnetdev)
 {
-       uint status = _SUCCESS;
        struct registry_priv  *registry_par = &padapter->registrypriv;
 
        registry_par->chip_version = (u8)chip_version;
@@ -172,7 +170,6 @@ static uint loadparam(struct _adapter *padapter, struct  net_device *pnetdev)
        registry_par->low_power = (u8)low_power;
        registry_par->wifi_test = (u8) wifi_test;
        r8712_initmac = initmac;
-       return status;
 }
 
 static int r871x_net_set_mac_address(struct net_device *pnetdev, void *p)
@@ -180,8 +177,8 @@ static int r871x_net_set_mac_address(struct net_device *pnetdev, void *p)
        struct _adapter *padapter = netdev_priv(pnetdev);
        struct sockaddr *addr = p;
 
-       if (padapter->bup == false)
-               memcpy(pnetdev->dev_addr, addr->sa_data, ETH_ALEN);
+       if (!padapter->bup)
+               ether_addr_copy(pnetdev->dev_addr, addr->sa_data);
        return 0;
 }
 
@@ -228,7 +225,6 @@ struct net_device *r8712_init_netdev(void)
        pnetdev->watchdog_timeo = HZ; /* 1 second timeout */
        pnetdev->wireless_handlers = (struct iw_handler_def *)
                                     &r871x_handlers_def;
-       /*step 2.*/
        loadparam(padapter, pnetdev);
        netif_carrier_off(pnetdev);
        padapter->pid = 0;  /* Initial the PID value used for HW PBC.*/
@@ -337,7 +333,7 @@ u8 r8712_init_drv_sw(struct _adapter *padapter)
 
 u8 r8712_free_drv_sw(struct _adapter *padapter)
 {
-       struct net_device *pnetdev = (struct net_device *)padapter->pnetdev;
+       struct net_device *pnetdev = padapter->pnetdev;
 
        r8712_free_cmd_priv(&padapter->cmdpriv);
        r8712_free_evt_priv(&padapter->evtpriv);
@@ -370,7 +366,8 @@ static void enable_video_mode(struct _adapter *padapter, int cbw40_value)
 
        if (cbw40_value) {
                /* if the driver supports the 40M bandwidth,
-                * we can enable the bit 9.*/
+                * we can enable the bit 9.
+                */
                intcmd |= 0x200;
        }
        r8712_fw_cmd(padapter, intcmd);
@@ -387,7 +384,7 @@ static int netdev_open(struct net_device *pnetdev)
        struct _adapter *padapter = netdev_priv(pnetdev);
 
        mutex_lock(&padapter->mutex_start);
-       if (padapter->bup == false) {
+       if (!padapter->bup) {
                padapter->bDriverStopped = false;
                padapter->bSurpriseRemoved = false;
                padapter->bup = true;