aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/pwc/pwc-ctrl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/usb/pwc/pwc-ctrl.c')
-rw-r--r--drivers/media/usb/pwc/pwc-ctrl.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/media/usb/pwc/pwc-ctrl.c b/drivers/media/usb/pwc/pwc-ctrl.c
index 655cef39eb3d..b681a184ef87 100644
--- a/drivers/media/usb/pwc/pwc-ctrl.c
+++ b/drivers/media/usb/pwc/pwc-ctrl.c
@@ -242,14 +242,14 @@ static int set_video_mode_Timon(struct pwc_device *pdev, int size, int pixfmt,
242 fps = (frames / 5) - 1; 242 fps = (frames / 5) - 1;
243 243
244 /* Find a supported framerate with progressively higher compression */ 244 /* Find a supported framerate with progressively higher compression */
245 pChoose = NULL; 245 do {
246 while (*compression <= 3) {
247 pChoose = &Timon_table[size][fps][*compression]; 246 pChoose = &Timon_table[size][fps][*compression];
248 if (pChoose->alternate != 0) 247 if (pChoose->alternate != 0)
249 break; 248 break;
250 (*compression)++; 249 (*compression)++;
251 } 250 } while (*compression <= 3);
252 if (pChoose == NULL || pChoose->alternate == 0) 251
252 if (pChoose->alternate == 0)
253 return -ENOENT; /* Not supported. */ 253 return -ENOENT; /* Not supported. */
254 254
255 if (send_to_cam) 255 if (send_to_cam)
@@ -279,7 +279,7 @@ static int set_video_mode_Timon(struct pwc_device *pdev, int size, int pixfmt,
279static int set_video_mode_Kiara(struct pwc_device *pdev, int size, int pixfmt, 279static int set_video_mode_Kiara(struct pwc_device *pdev, int size, int pixfmt,
280 int frames, int *compression, int send_to_cam) 280 int frames, int *compression, int send_to_cam)
281{ 281{
282 const struct Kiara_table_entry *pChoose = NULL; 282 const struct Kiara_table_entry *pChoose;
283 int fps, ret = 0; 283 int fps, ret = 0;
284 284
285 if (size >= PSZ_MAX || *compression < 0 || *compression > 3) 285 if (size >= PSZ_MAX || *compression < 0 || *compression > 3)
@@ -293,13 +293,14 @@ static int set_video_mode_Kiara(struct pwc_device *pdev, int size, int pixfmt,
293 fps = (frames / 5) - 1; 293 fps = (frames / 5) - 1;
294 294
295 /* Find a supported framerate with progressively higher compression */ 295 /* Find a supported framerate with progressively higher compression */
296 while (*compression <= 3) { 296 do {
297 pChoose = &Kiara_table[size][fps][*compression]; 297 pChoose = &Kiara_table[size][fps][*compression];
298 if (pChoose->alternate != 0) 298 if (pChoose->alternate != 0)
299 break; 299 break;
300 (*compression)++; 300 (*compression)++;
301 } 301 } while (*compression <= 3);
302 if (pChoose == NULL || pChoose->alternate == 0) 302
303 if (pChoose->alternate == 0)
303 return -ENOENT; /* Not supported. */ 304 return -ENOENT; /* Not supported. */
304 305
305 /* Firmware bug: video endpoint is 5, but commands are sent to endpoint 4 */ 306 /* Firmware bug: video endpoint is 5, but commands are sent to endpoint 4 */