Commit ea9a8dae authored by Martin Kepplinger's avatar Martin Kepplinger Committed by Greg Kroah-Hartman

staging: vt6656: make spin_lock_irq() human readable

Don't require FIRMWAREbDownload() to, first off, unlock a held lock.
Thus do all locking in main_usb.c and hold it for a insignificantly
shorter period of time. This makes the affected area significantly more
readable though.
Signed-off-by: default avatarMartin Kepplinger <martink@posteo.de>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bc5cf656
...@@ -55,7 +55,6 @@ int FIRMWAREbDownload(struct vnt_private *pDevice) __must_hold(&pDevice->lock) ...@@ -55,7 +55,6 @@ int FIRMWAREbDownload(struct vnt_private *pDevice) __must_hold(&pDevice->lock)
int ii, rc; int ii, rc;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Download firmware\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Download firmware\n");
spin_unlock_irq(&pDevice->lock);
rc = request_firmware(&fw, FIRMWARE_NAME, dev); rc = request_firmware(&fw, FIRMWARE_NAME, dev);
if (rc) { if (rc) {
...@@ -92,7 +91,6 @@ int FIRMWAREbDownload(struct vnt_private *pDevice) __must_hold(&pDevice->lock) ...@@ -92,7 +91,6 @@ int FIRMWAREbDownload(struct vnt_private *pDevice) __must_hold(&pDevice->lock)
out: out:
kfree(pBuffer); kfree(pBuffer);
spin_lock_irq(&pDevice->lock);
return result; return result;
} }
MODULE_FIRMWARE(FIRMWARE_NAME); MODULE_FIRMWARE(FIRMWARE_NAME);
......
...@@ -319,7 +319,11 @@ static int device_init_registers(struct vnt_private *pDevice) ...@@ -319,7 +319,11 @@ static int device_init_registers(struct vnt_private *pDevice)
memcpy(pDevice->abySNAP_Bridgetunnel, abySNAP_Bridgetunnel, ETH_ALEN); memcpy(pDevice->abySNAP_Bridgetunnel, abySNAP_Bridgetunnel, ETH_ALEN);
if (!FIRMWAREbCheckVersion(pDevice)) { if (!FIRMWAREbCheckVersion(pDevice)) {
spin_unlock_irq(&pDevice->lock);
if (FIRMWAREbDownload(pDevice) == true) { if (FIRMWAREbDownload(pDevice) == true) {
spin_lock_irq(&pDevice->lock);
if (FIRMWAREbBrach2Sram(pDevice) == false) { if (FIRMWAREbBrach2Sram(pDevice) == false) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
" FIRMWAREbBrach2Sram fail\n"); " FIRMWAREbBrach2Sram fail\n");
...@@ -329,7 +333,6 @@ static int device_init_registers(struct vnt_private *pDevice) ...@@ -329,7 +333,6 @@ static int device_init_registers(struct vnt_private *pDevice)
} else { } else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
" FIRMWAREbDownload fail\n"); " FIRMWAREbDownload fail\n");
spin_unlock_irq(&pDevice->lock);
return false; return false;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment