diff options
author | Malcolm Priestley <tvboxspy@gmail.com> | 2012-10-07 11:41:31 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-22 13:26:40 -0700 |
commit | f20fbdf829c11c3c29ee94c0c10ec6195ac4c362 (patch) | |
tree | fe84d72d1e169bb9335b50c79f16604d251b738d /drivers/staging/vt6656/firmware.c | |
parent | ab1dd9963137a1e122004d5378a581bf16ae9bc8 (diff) | |
download | linux-f20fbdf829c11c3c29ee94c0c10ec6195ac4c362.tar.gz linux-f20fbdf829c11c3c29ee94c0c10ec6195ac4c362.tar.bz2 linux-f20fbdf829c11c3c29ee94c0c10ec6195ac4c362.zip |
staging: vt6656: Keep firmware loading local and release firware.
Firmware is retained unreleased for the entire duration of the
driver.
When done release firmware and if the need be request firmware again.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vt6656/firmware.c')
-rw-r--r-- | drivers/staging/vt6656/firmware.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/staging/vt6656/firmware.c b/drivers/staging/vt6656/firmware.c index 8c8126a3540b..8831ea03c001 100644 --- a/drivers/staging/vt6656/firmware.c +++ b/drivers/staging/vt6656/firmware.c @@ -61,28 +61,24 @@ FIRMWAREbDownload( PSDevice pDevice ) { + struct device *dev = &pDevice->usb->dev; const struct firmware *fw; int NdisStatus; void *pBuffer = NULL; BOOL result = FALSE; u16 wLength; - int ii; + int ii, rc; + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Download firmware\n"); spin_unlock_irq(&pDevice->lock); - if (!pDevice->firmware) { - struct device *dev = &pDevice->usb->dev; - int rc; - - rc = request_firmware(&pDevice->firmware, FIRMWARE_NAME, dev); - if (rc) { - dev_err(dev, "firmware file %s request failed (%d)\n", - FIRMWARE_NAME, rc); + rc = request_firmware(&fw, FIRMWARE_NAME, dev); + if (rc) { + dev_err(dev, "firmware file %s request failed (%d)\n", + FIRMWARE_NAME, rc); goto out; - } } - fw = pDevice->firmware; pBuffer = kmalloc(FIRMWARE_CHUNK_SIZE, GFP_KERNEL); if (!pBuffer) @@ -103,10 +99,12 @@ FIRMWAREbDownload( DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Download firmware...%d %zu\n", ii, fw->size); if (NdisStatus != STATUS_SUCCESS) - goto out; + goto free_fw; } result = TRUE; +free_fw: + release_firmware(fw); out: kfree(pBuffer); |