staging: vt6656: Convert remaining locks to spin_lock_irqsave.
authorMalcolm Priestley <tvboxspy@gmail.com>
Sat, 24 May 2014 13:36:57 +0000 (14:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 May 2014 17:58:24 +0000 (10:58 -0700)
Convert all remaining locks to spin_lock_irqsave and
spin_unlock_irqrestore

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6656/dpc.c
drivers/staging/vt6656/int.c
drivers/staging/vt6656/iwctl.c

index 286e7352ce1d3c9383b04bead5b5348ddef4e60a..c0ec5b37aa7ceebc10d84c3908809a7437735c72 100644 (file)
@@ -863,13 +863,14 @@ void RXvWorkItem(struct work_struct *work)
                container_of(work, struct vnt_private, read_work_item);
        int status;
        struct vnt_rcb *rcb = NULL;
+       unsigned long flags;
 
        if (priv->Flags & fMP_DISCONNECTED)
                return;
 
        DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Rx Polling Thread\n");
 
-       spin_lock_irq(&priv->lock);
+       spin_lock_irqsave(&priv->lock, flags);
 
        while ((priv->Flags & fMP_POST_READS) && MP_IS_READY(priv) &&
                        (priv->NumRecvFreeList != 0)) {
@@ -884,7 +885,7 @@ void RXvWorkItem(struct work_struct *work)
 
        priv->bIsRxWorkItemQueued = false;
 
-       spin_unlock_irq(&priv->lock);
+       spin_unlock_irqrestore(&priv->lock, flags);
 }
 
 void RXvFreeRCB(struct vnt_rcb *rcb, int re_alloc_skb)
index cca56b2f243dd83c0bc78dd2b82d8a7f19537119..f2a5225b50f82bc6c64398e3efbd0adbf110cee7 100644 (file)
@@ -65,15 +65,16 @@ static int msglevel = MSG_LEVEL_INFO; /* MSG_LEVEL_DEBUG */
 -*/
 void INTvWorkItem(struct vnt_private *pDevice)
 {
+       unsigned long flags;
        int ntStatus;
 
        DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Interrupt Polling Thread\n");
 
-       spin_lock_irq(&pDevice->lock);
+       spin_lock_irqsave(&pDevice->lock, flags);
 
        ntStatus = PIPEnsInterruptRead(pDevice);
 
-       spin_unlock_irq(&pDevice->lock);
+       spin_unlock_irqrestore(&pDevice->lock, flags);
 }
 
 void INTnsProcessData(struct vnt_private *priv)
index 3edeb2f44f6a57c75d8a7eb159c0b48d48a94c80..e7b7ca5586cccc31409ec1be5d4c05ef3d980fb6 100644 (file)
@@ -91,6 +91,7 @@ int iwctl_siwscan(struct net_device *dev, struct iw_request_info *info,
        struct iw_scan_req *req = (struct iw_scan_req *)extra;
        u8 abyScanSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1];
        PWLAN_IE_SSID pItemSSID = NULL;
+       unsigned long flags;
 
        if (!(pDevice->flags & DEVICE_FLAGS_OPENED))
                return -EINVAL;
@@ -115,7 +116,7 @@ int iwctl_siwscan(struct net_device *dev, struct iw_request_info *info,
                return 0;
        }
 
-       spin_lock_irq(&pDevice->lock);
+       spin_lock_irqsave(&pDevice->lock, flags);
 
        BSSvClearBSSList((void *)pDevice, pDevice->bLinkPass);
 
@@ -136,7 +137,8 @@ int iwctl_siwscan(struct net_device *dev, struct iw_request_info *info,
                        PRINT_K("SIOCSIWSCAN:[desired_ssid=%s,len=%d]\n", ((PWLAN_IE_SSID)abyScanSSID)->abySSID,
                                ((PWLAN_IE_SSID)abyScanSSID)->len);
                        bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, abyScanSSID);
-                       spin_unlock_irq(&pDevice->lock);
+
+                       spin_unlock_irqrestore(&pDevice->lock, flags);
 
                        return 0;
                } else if (req->scan_type == IW_SCAN_TYPE_PASSIVE) { // passive scan
@@ -148,7 +150,8 @@ int iwctl_siwscan(struct net_device *dev, struct iw_request_info *info,
 
        pMgmt->eScanType = WMAC_SCAN_PASSIVE;
        bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, NULL);
-       spin_unlock_irq(&pDevice->lock);
+
+       spin_unlock_irqrestore(&pDevice->lock, flags);
 
        return 0;
 }
@@ -375,6 +378,7 @@ int iwctl_siwmode(struct net_device *dev, struct iw_request_info *info,
        struct vnt_private *pDevice = netdev_priv(dev);
        __u32 *wmode = &wrqu->mode;
        struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
+       unsigned long flags;
        int rc = 0;
 
        DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWMODE\n");
@@ -415,10 +419,13 @@ int iwctl_siwmode(struct net_device *dev, struct iw_request_info *info,
        if (pDevice->bCommit) {
                if (pMgmt->eConfigMode == WMAC_CONFIG_AP) {
                        netif_stop_queue(pDevice->dev);
-                       spin_lock_irq(&pDevice->lock);
+
+                       spin_lock_irqsave(&pDevice->lock, flags);
+
                        bScheduleCommand((void *) pDevice,
                                WLAN_CMD_RUN_AP, NULL);
-                       spin_unlock_irq(&pDevice->lock);
+
+                       spin_unlock_irqrestore(&pDevice->lock, flags);
                } else {
                        DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
                                "Commit the settings\n");