aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-av-firmware.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx18/cx18-av-firmware.c')
-rw-r--r--drivers/media/video/cx18/cx18-av-firmware.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/media/video/cx18/cx18-av-firmware.c b/drivers/media/video/cx18/cx18-av-firmware.c
index 834b9248242e..e996a4e3123a 100644
--- a/drivers/media/video/cx18/cx18-av-firmware.c
+++ b/drivers/media/video/cx18/cx18-av-firmware.c
@@ -32,7 +32,7 @@ int cx18_av_loadfw(struct cx18 *cx)
32 u32 v; 32 u32 v;
33 const u8 *ptr; 33 const u8 *ptr;
34 int i; 34 int i;
35 int retries = 0; 35 int retries1 = 0;
36 36
37 if (request_firmware(&fw, FWFILE, &cx->dev->dev) != 0) { 37 if (request_firmware(&fw, FWFILE, &cx->dev->dev) != 0) {
38 CX18_ERR("unable to open firmware %s\n", FWFILE); 38 CX18_ERR("unable to open firmware %s\n", FWFILE);
@@ -41,7 +41,7 @@ int cx18_av_loadfw(struct cx18 *cx)
41 41
42 /* The firmware load often has byte errors, so allow for several 42 /* The firmware load often has byte errors, so allow for several
43 retries, both at byte level and at the firmware load level. */ 43 retries, both at byte level and at the firmware load level. */
44 while (retries < 5) { 44 while (retries1 < 5) {
45 cx18_av_write4(cx, CXADEC_CHIP_CTRL, 0x00010000); 45 cx18_av_write4(cx, CXADEC_CHIP_CTRL, 0x00010000);
46 cx18_av_write(cx, CXADEC_STD_DET_CTL, 0xf6); 46 cx18_av_write(cx, CXADEC_STD_DET_CTL, 0xf6);
47 47
@@ -57,9 +57,9 @@ int cx18_av_loadfw(struct cx18 *cx)
57 for (i = 0; i < size; i++) { 57 for (i = 0; i < size; i++) {
58 u32 dl_control = 0x0F000000 | i | ((u32)ptr[i] << 16); 58 u32 dl_control = 0x0F000000 | i | ((u32)ptr[i] << 16);
59 u32 value = 0; 59 u32 value = 0;
60 int retries; 60 int retries2;
61 61
62 for (retries = 0; retries < 5; retries++) { 62 for (retries2 = 0; retries2 < 5; retries2++) {
63 cx18_av_write4(cx, CXADEC_DL_CTL, dl_control); 63 cx18_av_write4(cx, CXADEC_DL_CTL, dl_control);
64 udelay(10); 64 udelay(10);
65 value = cx18_av_read4(cx, CXADEC_DL_CTL); 65 value = cx18_av_read4(cx, CXADEC_DL_CTL);
@@ -69,18 +69,18 @@ int cx18_av_loadfw(struct cx18 *cx)
69 the address. We can only write the lower 69 the address. We can only write the lower
70 address byte of the address. */ 70 address byte of the address. */
71 if ((value & 0x3F00) != (dl_control & 0x3F00)) { 71 if ((value & 0x3F00) != (dl_control & 0x3F00)) {
72 retries = 5; 72 retries2 = 5;
73 break; 73 break;
74 } 74 }
75 } 75 }
76 if (retries >= 5) 76 if (retries2 >= 5)
77 break; 77 break;
78 } 78 }
79 if (i == size) 79 if (i == size)
80 break; 80 break;
81 retries++; 81 retries1++;
82 } 82 }
83 if (retries >= 5) { 83 if (retries1 >= 5) {
84 CX18_ERR("unable to load firmware %s\n", FWFILE); 84 CX18_ERR("unable to load firmware %s\n", FWFILE);
85 release_firmware(fw); 85 release_firmware(fw);
86 return -EIO; 86 return -EIO;