Commit 21684ba9 authored by Mike Isely's avatar Mike Isely Committed by Mauro Carvalho Chehab

V4L/DVB (7721): pvrusb2: Restructure cx23416 firmware loading to have a common exit point

Signed-off-by: default avatarMike Isely <isely@pobox.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 17a7b664
...@@ -1252,7 +1252,7 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) ...@@ -1252,7 +1252,7 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
pvr2_trace(PVR2_TRACE_ERROR_LEGS, pvr2_trace(PVR2_TRACE_ERROR_LEGS,
"firmware2 upload prep failed, ret=%d",ret); "firmware2 upload prep failed, ret=%d",ret);
release_firmware(fw_entry); release_firmware(fw_entry);
return ret; goto done;
} }
/* Now send firmware */ /* Now send firmware */
...@@ -1265,7 +1265,8 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) ...@@ -1265,7 +1265,8 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
" must be a multiple of %zu bytes", " must be a multiple of %zu bytes",
fw_files[fwidx],sizeof(u32)); fw_files[fwidx],sizeof(u32));
release_firmware(fw_entry); release_firmware(fw_entry);
return -EINVAL; ret = -EINVAL;
goto done;
} }
fw_ptr = kmalloc(FIRMWARE_CHUNK_SIZE, GFP_KERNEL); fw_ptr = kmalloc(FIRMWARE_CHUNK_SIZE, GFP_KERNEL);
...@@ -1273,7 +1274,8 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) ...@@ -1273,7 +1274,8 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
release_firmware(fw_entry); release_firmware(fw_entry);
pvr2_trace(PVR2_TRACE_ERROR_LEGS, pvr2_trace(PVR2_TRACE_ERROR_LEGS,
"failed to allocate memory for firmware2 upload"); "failed to allocate memory for firmware2 upload");
return -ENOMEM; ret = -ENOMEM;
goto done;
} }
pipe = usb_sndbulkpipe(hdw->usb_dev, PVR2_FIRMWARE_ENDPOINT); pipe = usb_sndbulkpipe(hdw->usb_dev, PVR2_FIRMWARE_ENDPOINT);
...@@ -1304,7 +1306,7 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) ...@@ -1304,7 +1306,7 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
if (ret) { if (ret) {
pvr2_trace(PVR2_TRACE_ERROR_LEGS, pvr2_trace(PVR2_TRACE_ERROR_LEGS,
"firmware2 upload transfer failure"); "firmware2 upload transfer failure");
return ret; goto done;
} }
/* Finish upload */ /* Finish upload */
...@@ -1317,6 +1319,8 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) ...@@ -1317,6 +1319,8 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
pvr2_trace(PVR2_TRACE_ERROR_LEGS, pvr2_trace(PVR2_TRACE_ERROR_LEGS,
"firmware2 upload post-proc failure"); "firmware2 upload post-proc failure");
} }
done:
return ret; return ret;
} }
......
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