diff options
author | Erik Andr?n <erik.andren@gmail.com> | 2008-12-27 12:06:06 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-04-06 20:44:36 -0400 |
commit | dc913258ffb3dd90d6bafdd9111565777b5aad08 (patch) | |
tree | 03535676959f2f0c54db21d1b4e88ec404d4ab7f /drivers/media | |
parent | e31f9dd6624de2250d32b7ca88042b0bc51b3cc5 (diff) |
V4L/DVB (11407): gspca - m5602-ov9650: Clean up ov9650_start() function.
Cleans some unnecessary temporary variable usage in the ov9650 start function.
Signed-off-by: Erik Andr?n <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_ov9650.c | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_ov9650.c b/drivers/media/video/gspca/m5602/m5602_ov9650.c index a50432c6269..76317e274bf 100644 --- a/drivers/media/video/gspca/m5602/m5602_ov9650.c +++ b/drivers/media/video/gspca/m5602/m5602_ov9650.c | |||
@@ -147,10 +147,8 @@ int ov9650_start(struct sd *sd) | |||
147 | int i, err = 0; | 147 | int i, err = 0; |
148 | struct cam *cam = &sd->gspca_dev.cam; | 148 | struct cam *cam = &sd->gspca_dev.cam; |
149 | 149 | ||
150 | for (i = 0; i < ARRAY_SIZE(res_init_ov9650) && !err; i++) { | 150 | for (i = 0; i < ARRAY_SIZE(res_init_ov9650) && !err; i++) |
151 | u8 data = res_init_ov9650[i][1]; | 151 | err = m5602_write_bridge(sd, res_init_ov9650[i][0], res_init_ov9650[i][1]); |
152 | err = m5602_write_bridge(sd, res_init_ov9650[i][0], data); | ||
153 | } | ||
154 | if (err < 0) | 152 | if (err < 0) |
155 | return err; | 153 | return err; |
156 | 154 | ||
@@ -160,12 +158,14 @@ int ov9650_start(struct sd *sd) | |||
160 | PDEBUG(D_V4L2, "Configuring camera for VGA mode"); | 158 | PDEBUG(D_V4L2, "Configuring camera for VGA mode"); |
161 | 159 | ||
162 | for (i = 0; i < ARRAY_SIZE(VGA_ov9650) && !err; i++) { | 160 | for (i = 0; i < ARRAY_SIZE(VGA_ov9650) && !err; i++) { |
163 | u8 data = VGA_ov9650[i][2]; | 161 | if (VGA_ov9650[i][0] == SENSOR) { |
164 | if (VGA_ov9650[i][0] == SENSOR) | 162 | u8 data = VGA_ov9650[i][2]; |
163 | |||
165 | err = m5602_write_sensor(sd, | 164 | err = m5602_write_sensor(sd, |
166 | VGA_ov9650[i][1], &data, 1); | 165 | VGA_ov9650[i][1], &data, 1); |
167 | else | 166 | } else { |
168 | err = m5602_write_bridge(sd, VGA_ov9650[i][1], data); | 167 | err = m5602_write_bridge(sd, VGA_ov9650[i][1], VGA_ov9650[i][2]); |
168 | } | ||
169 | } | 169 | } |
170 | break; | 170 | break; |
171 | 171 | ||
@@ -173,12 +173,14 @@ int ov9650_start(struct sd *sd) | |||
173 | PDEBUG(D_V4L2, "Configuring camera for CIF mode"); | 173 | PDEBUG(D_V4L2, "Configuring camera for CIF mode"); |
174 | 174 | ||
175 | for (i = 0; i < ARRAY_SIZE(CIF_ov9650) && !err; i++) { | 175 | for (i = 0; i < ARRAY_SIZE(CIF_ov9650) && !err; i++) { |
176 | u8 data = CIF_ov9650[i][2]; | 176 | if (CIF_ov9650[i][0] == SENSOR) { |
177 | if (CIF_ov9650[i][0] == SENSOR) | 177 | u8 data = CIF_ov9650[i][2]; |
178 | |||
178 | err = m5602_write_sensor(sd, | 179 | err = m5602_write_sensor(sd, |
179 | CIF_ov9650[i][1], &data, 1); | 180 | CIF_ov9650[i][1], &data, 1); |
180 | else | 181 | } else { |
181 | err = m5602_write_bridge(sd, CIF_ov9650[i][1], data); | 182 | err = m5602_write_bridge(sd, CIF_ov9650[i][1], CIF_ov9650[i][2]); |
183 | } | ||
182 | } | 184 | } |
183 | break; | 185 | break; |
184 | 186 | ||
@@ -186,12 +188,14 @@ int ov9650_start(struct sd *sd) | |||
186 | PDEBUG(D_V4L2, "Configuring camera for QVGA mode"); | 188 | PDEBUG(D_V4L2, "Configuring camera for QVGA mode"); |
187 | 189 | ||
188 | for (i = 0; i < ARRAY_SIZE(QVGA_ov9650) && !err; i++) { | 190 | for (i = 0; i < ARRAY_SIZE(QVGA_ov9650) && !err; i++) { |
189 | u8 data = QVGA_ov9650[i][2]; | 191 | if (QVGA_ov9650[i][0] == SENSOR) { |
190 | if (QVGA_ov9650[i][0] == SENSOR) | 192 | u8 data = QVGA_ov9650[i][2]; |
193 | |||
191 | err = m5602_write_sensor(sd, | 194 | err = m5602_write_sensor(sd, |
192 | QVGA_ov9650[i][1], &data, 1); | 195 | QVGA_ov9650[i][1], &data, 1); |
193 | else | 196 | } else { |
194 | err = m5602_write_bridge(sd, QVGA_ov9650[i][1], data); | 197 | err = m5602_write_bridge(sd, QVGA_ov9650[i][1], QVGA_ov9650[i][2]); |
198 | } | ||
195 | } | 199 | } |
196 | break; | 200 | break; |
197 | 201 | ||
@@ -199,12 +203,13 @@ int ov9650_start(struct sd *sd) | |||
199 | PDEBUG(D_V4L2, "Configuring camera for QCIF mode"); | 203 | PDEBUG(D_V4L2, "Configuring camera for QCIF mode"); |
200 | 204 | ||
201 | for (i = 0; i < ARRAY_SIZE(QCIF_ov9650) && !err; i++) { | 205 | for (i = 0; i < ARRAY_SIZE(QCIF_ov9650) && !err; i++) { |
202 | u8 data = QCIF_ov9650[i][2]; | 206 | if (QCIF_ov9650[i][0] == SENSOR) { |
203 | if (QCIF_ov9650[i][0] == SENSOR) | 207 | u8 data = QCIF_ov9650[i][2]; |
204 | err = m5602_write_sensor(sd, | 208 | err = m5602_write_sensor(sd, |
205 | QCIF_ov9650[i][1], &data, 1); | 209 | QCIF_ov9650[i][1], &data, 1); |
206 | else | 210 | } else { |
207 | err = m5602_write_bridge(sd, QCIF_ov9650[i][1], data); | 211 | err = m5602_write_bridge(sd, QCIF_ov9650[i][1], QCIF_ov9650[i][2]); |
212 | } | ||
208 | } | 213 | } |
209 | break; | 214 | break; |
210 | 215 | ||