diff options
author | Mike Isely <isely@pobox.com> | 2008-04-20 22:49:33 -0500 |
---|---|---|
committer | Mike Isely <isely@pobox.com> | 2008-04-20 22:49:33 -0500 |
commit | 52ed711745ffff15fd684f36245e4edc09e9178d (patch) | |
tree | 16d7fd4388fa8244f6b3860c966e959bc62205ad /linux/drivers/media/video/pvrusb2 | |
parent | 9284edec6bf181b1f52f742a72f68a7eec7f65ed (diff) | |
download | mediapointer-dvb-s2-52ed711745ffff15fd684f36245e4edc09e9178d.tar.gz mediapointer-dvb-s2-52ed711745ffff15fd684f36245e4edc09e9178d.tar.bz2 |
pvrusb2: Restructure cx23416 firmware loading to have a common exit point
From: Mike Isely <isely@pobox.com>
Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers/media/video/pvrusb2')
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c index af8805017..351e0de63 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -1263,7 +1263,7 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) pvr2_trace(PVR2_TRACE_ERROR_LEGS, "firmware2 upload prep failed, ret=%d",ret); release_firmware(fw_entry); - return ret; + goto done; } /* Now send firmware */ @@ -1276,7 +1276,8 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) " must be a multiple of %zu bytes", fw_files[fwidx],sizeof(u32)); release_firmware(fw_entry); - return -EINVAL; + ret = -EINVAL; + goto done; } fw_ptr = kmalloc(FIRMWARE_CHUNK_SIZE, GFP_KERNEL); @@ -1284,7 +1285,8 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) release_firmware(fw_entry); pvr2_trace(PVR2_TRACE_ERROR_LEGS, "failed to allocate memory for firmware2 upload"); - return -ENOMEM; + ret = -ENOMEM; + goto done; } pipe = usb_sndbulkpipe(hdw->usb_dev, PVR2_FIRMWARE_ENDPOINT); @@ -1315,7 +1317,7 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) if (ret) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, "firmware2 upload transfer failure"); - return ret; + goto done; } /* Finish upload */ @@ -1328,6 +1330,8 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) pvr2_trace(PVR2_TRACE_ERROR_LEGS, "firmware2 upload post-proc failure"); } + + done: return ret; } |