aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2008-04-21 02:49:33 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:09:49 -0400
commit21684ba921d7758dc9264e0de64475b8a636ee95 (patch)
treeb27cb861e859285c753d6a908fb274ffd9e91278 /drivers/media/video/pvrusb2
parent17a7b6642da13f789471895677c98736ac85f43a (diff)
V4L/DVB (7721): pvrusb2: Restructure cx23416 firmware loading to have a common exit point
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pvrusb2')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index a3e40adc2c1..19de395a5fc 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -1252,7 +1252,7 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
1252 pvr2_trace(PVR2_TRACE_ERROR_LEGS, 1252 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
1253 "firmware2 upload prep failed, ret=%d",ret); 1253 "firmware2 upload prep failed, ret=%d",ret);
1254 release_firmware(fw_entry); 1254 release_firmware(fw_entry);
1255 return ret; 1255 goto done;
1256 } 1256 }
1257 1257
1258 /* Now send firmware */ 1258 /* Now send firmware */
@@ -1265,7 +1265,8 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
1265 " must be a multiple of %zu bytes", 1265 " must be a multiple of %zu bytes",
1266 fw_files[fwidx],sizeof(u32)); 1266 fw_files[fwidx],sizeof(u32));
1267 release_firmware(fw_entry); 1267 release_firmware(fw_entry);
1268 return -EINVAL; 1268 ret = -EINVAL;
1269 goto done;
1269 } 1270 }
1270 1271
1271 fw_ptr = kmalloc(FIRMWARE_CHUNK_SIZE, GFP_KERNEL); 1272 fw_ptr = kmalloc(FIRMWARE_CHUNK_SIZE, GFP_KERNEL);
@@ -1273,7 +1274,8 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
1273 release_firmware(fw_entry); 1274 release_firmware(fw_entry);
1274 pvr2_trace(PVR2_TRACE_ERROR_LEGS, 1275 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
1275 "failed to allocate memory for firmware2 upload"); 1276 "failed to allocate memory for firmware2 upload");
1276 return -ENOMEM; 1277 ret = -ENOMEM;
1278 goto done;
1277 } 1279 }
1278 1280
1279 pipe = usb_sndbulkpipe(hdw->usb_dev, PVR2_FIRMWARE_ENDPOINT); 1281 pipe = usb_sndbulkpipe(hdw->usb_dev, PVR2_FIRMWARE_ENDPOINT);
@@ -1304,7 +1306,7 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
1304 if (ret) { 1306 if (ret) {
1305 pvr2_trace(PVR2_TRACE_ERROR_LEGS, 1307 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
1306 "firmware2 upload transfer failure"); 1308 "firmware2 upload transfer failure");
1307 return ret; 1309 goto done;
1308 } 1310 }
1309 1311
1310 /* Finish upload */ 1312 /* Finish upload */
@@ -1317,6 +1319,8 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
1317 pvr2_trace(PVR2_TRACE_ERROR_LEGS, 1319 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
1318 "firmware2 upload post-proc failure"); 1320 "firmware2 upload post-proc failure");
1319 } 1321 }
1322
1323 done:
1320 return ret; 1324 return ret;
1321} 1325}
1322 1326