diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-13 13:41:23 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:08:00 -0400 |
commit | f245e549f0d1fb43fd6d7759d31cd763e6d914b6 (patch) | |
tree | 49a559218f8c301c025966193390ed85e1cfb3f6 /drivers/media/video/em28xx | |
parent | ca21d2dc945c224c3f121f6b5f2436877f029eed (diff) |
V4L/DVB (7545): em28xx: Fix CodingStyle errors and most warnings introduced by videobuf
The last videobuf changes introduced several CodingStyle errors. Fixes all those
errors, as reported by checkpatch.pl
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/em28xx')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-video.c | 151 |
1 files changed, 78 insertions, 73 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index 229d154424ff..c5593526a6e7 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -55,13 +55,13 @@ | |||
55 | dev->name, __func__ , ##arg); } while (0) | 55 | dev->name, __func__ , ##arg); } while (0) |
56 | 56 | ||
57 | static unsigned int isoc_debug; | 57 | static unsigned int isoc_debug; |
58 | module_param(isoc_debug,int,0644); | 58 | module_param(isoc_debug, int, 0644); |
59 | MODULE_PARM_DESC(isoc_debug,"enable debug messages [isoc transfers]"); | 59 | MODULE_PARM_DESC(isoc_debug, "enable debug messages [isoc transfers]"); |
60 | 60 | ||
61 | #define em28xx_isocdbg(fmt, arg...) do {\ | 61 | #define em28xx_isocdbg(fmt, arg...) do {\ |
62 | if (isoc_debug) \ | 62 | if (isoc_debug) \ |
63 | printk(KERN_INFO "%s %s :"fmt, \ | 63 | printk(KERN_INFO "%s %s :"fmt, \ |
64 | dev->name, __FUNCTION__ , ##arg); } while (0) | 64 | dev->name, __func__ , ##arg); } while (0) |
65 | 65 | ||
66 | #define BUFFER_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ | 66 | #define BUFFER_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
67 | 67 | ||
@@ -129,7 +129,7 @@ static struct usb_driver em28xx_usb_driver; | |||
129 | /* | 129 | /* |
130 | * Announces that a buffer were filled and request the next | 130 | * Announces that a buffer were filled and request the next |
131 | */ | 131 | */ |
132 | static void inline buffer_filled (struct em28xx *dev, | 132 | static inline void buffer_filled(struct em28xx *dev, |
133 | struct em28xx_dmaqueue *dma_q, | 133 | struct em28xx_dmaqueue *dma_q, |
134 | struct em28xx_buffer *buf) | 134 | struct em28xx_buffer *buf) |
135 | { | 135 | { |
@@ -163,9 +163,9 @@ static void em28xx_copy_video(struct em28xx *dev, | |||
163 | unsigned char *outp, unsigned long len) | 163 | unsigned char *outp, unsigned long len) |
164 | { | 164 | { |
165 | void *fieldstart, *startwrite, *startread; | 165 | void *fieldstart, *startwrite, *startread; |
166 | int linesdone, currlinedone, offset, lencopy,remain; | 166 | int linesdone, currlinedone, offset, lencopy, remain; |
167 | 167 | ||
168 | if(dev->frame_size != buf->vb.size){ | 168 | if (dev->frame_size != buf->vb.size) { |
169 | em28xx_errdev("size %i and buf.length %lu are different!\n", | 169 | em28xx_errdev("size %i and buf.length %lu are different!\n", |
170 | dev->frame_size, buf->vb.size); | 170 | dev->frame_size, buf->vb.size); |
171 | return; | 171 | return; |
@@ -178,7 +178,7 @@ static void em28xx_copy_video(struct em28xx *dev, | |||
178 | em28xx_isocdbg("frame is not complete\n"); | 178 | em28xx_isocdbg("frame is not complete\n"); |
179 | len += 4; | 179 | len += 4; |
180 | } else | 180 | } else |
181 | p +=4; | 181 | p += 4; |
182 | 182 | ||
183 | startread = p; | 183 | startread = p; |
184 | remain = len; | 184 | remain = len; |
@@ -196,10 +196,11 @@ static void em28xx_copy_video(struct em28xx *dev, | |||
196 | lencopy = dev->bytesperline - currlinedone; | 196 | lencopy = dev->bytesperline - currlinedone; |
197 | lencopy = lencopy > remain ? remain : lencopy; | 197 | lencopy = lencopy > remain ? remain : lencopy; |
198 | 198 | ||
199 | if((char*)startwrite + lencopy > (char*)outp + buf->vb.size) { | 199 | if ((char *)startwrite + lencopy > (char *)outp + buf->vb.size) { |
200 | em28xx_isocdbg("Overflow of %zi bytes past buffer end (1)\n", | 200 | em28xx_isocdbg("Overflow of %zi bytes past buffer end (1)\n", |
201 | ((char*)startwrite + lencopy) - ((char*)outp + buf->vb.size)); | 201 | ((char *)startwrite + lencopy) - |
202 | lencopy = remain = (char*)outp + buf->vb.size - (char*)startwrite; | 202 | ((char *)outp + buf->vb.size)); |
203 | lencopy = remain = (char *)outp + buf->vb.size - (char *)startwrite; | ||
203 | } | 204 | } |
204 | BUG_ON(lencopy <= 0); | 205 | BUG_ON(lencopy <= 0); |
205 | memcpy(startwrite, startread, lencopy); | 206 | memcpy(startwrite, startread, lencopy); |
@@ -216,12 +217,15 @@ static void em28xx_copy_video(struct em28xx *dev, | |||
216 | 217 | ||
217 | BUG_ON(lencopy <= 0); | 218 | BUG_ON(lencopy <= 0); |
218 | 219 | ||
219 | if((char*)startwrite + lencopy > (char*)outp + buf->vb.size) { | 220 | if ((char *)startwrite + lencopy > (char *)outp + buf->vb.size) { |
220 | em28xx_isocdbg("Overflow of %zi bytes past buffer end (2)\n", | 221 | em28xx_isocdbg("Overflow of %zi bytes past buffer end (2)\n", |
221 | ((char*)startwrite + lencopy) - ((char*)outp + buf->vb.size)); | 222 | ((char *)startwrite + lencopy) - |
222 | lencopy = remain = (char*)outp + buf->vb.size - (char*)startwrite; | 223 | ((char *)outp + buf->vb.size)); |
224 | lencopy = remain = (char *)outp + buf->vb.size - | ||
225 | (char *)startwrite; | ||
223 | } | 226 | } |
224 | if(lencopy <= 0) break; | 227 | if (lencopy <= 0) |
228 | break; | ||
225 | 229 | ||
226 | memcpy(startwrite, startread, lencopy); | 230 | memcpy(startwrite, startread, lencopy); |
227 | 231 | ||
@@ -231,12 +235,12 @@ static void em28xx_copy_video(struct em28xx *dev, | |||
231 | dma_q->pos += len; | 235 | dma_q->pos += len; |
232 | } | 236 | } |
233 | 237 | ||
234 | static void inline print_err_status (struct em28xx *dev, | 238 | static inline void print_err_status(struct em28xx *dev, |
235 | int packet, int status) | 239 | int packet, int status) |
236 | { | 240 | { |
237 | char *errmsg = "Unknown"; | 241 | char *errmsg = "Unknown"; |
238 | 242 | ||
239 | switch(status) { | 243 | switch (status) { |
240 | case -ENOENT: | 244 | case -ENOENT: |
241 | errmsg = "unlinked synchronuously"; | 245 | errmsg = "unlinked synchronuously"; |
242 | break; | 246 | break; |
@@ -262,7 +266,7 @@ static void inline print_err_status (struct em28xx *dev, | |||
262 | errmsg = "Device does not respond"; | 266 | errmsg = "Device does not respond"; |
263 | break; | 267 | break; |
264 | } | 268 | } |
265 | if (packet<0) { | 269 | if (packet < 0) { |
266 | em28xx_isocdbg("URB status %d [%s].\n", status, errmsg); | 270 | em28xx_isocdbg("URB status %d [%s].\n", status, errmsg); |
267 | } else { | 271 | } else { |
268 | em28xx_isocdbg("URB packet %d, status %d [%s].\n", | 272 | em28xx_isocdbg("URB packet %d, status %d [%s].\n", |
@@ -273,7 +277,7 @@ static void inline print_err_status (struct em28xx *dev, | |||
273 | /* | 277 | /* |
274 | * video-buf generic routine to get the next available buffer | 278 | * video-buf generic routine to get the next available buffer |
275 | */ | 279 | */ |
276 | static int inline get_next_buf (struct em28xx_dmaqueue *dma_q, | 280 | static inline int get_next_buf(struct em28xx_dmaqueue *dma_q, |
277 | struct em28xx_buffer **buf) | 281 | struct em28xx_buffer **buf) |
278 | { | 282 | { |
279 | struct em28xx *dev = container_of(dma_q, struct em28xx, vidq); | 283 | struct em28xx *dev = container_of(dma_q, struct em28xx, vidq); |
@@ -306,33 +310,33 @@ static inline int em28xx_isoc_copy(struct urb *urb) | |||
306 | if ((dev->state & DEV_DISCONNECTED) || (dev->state & DEV_MISCONFIGURED)) | 310 | if ((dev->state & DEV_DISCONNECTED) || (dev->state & DEV_MISCONFIGURED)) |
307 | return 0; | 311 | return 0; |
308 | 312 | ||
309 | if (urb->status<0) { | 313 | if (urb->status < 0) { |
310 | print_err_status (dev,-1,urb->status); | 314 | print_err_status(dev, -1, urb->status); |
311 | if (urb->status == -ENOENT) | 315 | if (urb->status == -ENOENT) |
312 | return 0; | 316 | return 0; |
313 | } | 317 | } |
314 | 318 | ||
315 | buf=dev->isoc_ctl.buf; | 319 | buf = dev->isoc_ctl.buf; |
316 | 320 | ||
317 | if (!buf) { | 321 | if (!buf) { |
318 | rc=get_next_buf (dma_q, &buf); | 322 | rc = get_next_buf(dma_q, &buf); |
319 | if (rc<=0) | 323 | if (rc <= 0) |
320 | return rc; | 324 | return rc; |
321 | } | 325 | } |
322 | 326 | ||
323 | outp = videobuf_to_vmalloc (&buf->vb); | 327 | outp = videobuf_to_vmalloc(&buf->vb); |
324 | 328 | ||
325 | 329 | ||
326 | for (i = 0; i < urb->number_of_packets; i++) { | 330 | for (i = 0; i < urb->number_of_packets; i++) { |
327 | int status = urb->iso_frame_desc[i].status; | 331 | int status = urb->iso_frame_desc[i].status; |
328 | 332 | ||
329 | if (status<0) { | 333 | if (status < 0) { |
330 | print_err_status (dev,i,status); | 334 | print_err_status(dev, i, status); |
331 | if (urb->iso_frame_desc[i].status != -EPROTO) | 335 | if (urb->iso_frame_desc[i].status != -EPROTO) |
332 | continue; | 336 | continue; |
333 | } | 337 | } |
334 | 338 | ||
335 | len=urb->iso_frame_desc[i].actual_length - 4; | 339 | len = urb->iso_frame_desc[i].actual_length - 4; |
336 | 340 | ||
337 | if (urb->iso_frame_desc[i].actual_length <= 0) { | 341 | if (urb->iso_frame_desc[i].actual_length <= 0) { |
338 | /* em28xx_isocdbg("packet %d is empty",i); - spammy */ | 342 | /* em28xx_isocdbg("packet %d is empty",i); - spammy */ |
@@ -353,25 +357,25 @@ static inline int em28xx_isoc_copy(struct urb *urb) | |||
353 | /* FIXME - are the fields the right way around? */ | 357 | /* FIXME - are the fields the right way around? */ |
354 | em28xx_isocdbg("Video frame, length=%i, %s\n", len, | 358 | em28xx_isocdbg("Video frame, length=%i, %s\n", len, |
355 | (p[2] & 1)? "top" : "bottom"); | 359 | (p[2] & 1)? "top" : "bottom"); |
356 | em28xx_isocdbg("Current buffer is: outp = 0x%p, len = %i\n", outp, (int)buf->vb.size); | 360 | em28xx_isocdbg("Current buffer is: outp = 0x%p," |
361 | " len = %i\n", outp, (int)buf->vb.size); | ||
357 | 362 | ||
358 | if (p[2] & 1) { | 363 | if (p[2] & 1) { |
359 | if (buf->receiving) { | 364 | if (buf->receiving) { |
360 | buffer_filled (dev, dma_q, buf); | 365 | buffer_filled(dev, dma_q, buf); |
361 | rc=get_next_buf (dma_q, &buf); | 366 | rc = get_next_buf(dma_q, &buf); |
362 | if (rc<=0) | 367 | if (rc <= 0) |
363 | return rc; | 368 | return rc; |
364 | 369 | ||
365 | outp = videobuf_to_vmalloc (&buf->vb); | 370 | outp = videobuf_to_vmalloc(&buf->vb); |
366 | } | 371 | } |
367 | 372 | ||
368 | buf->top_field = 1; | 373 | buf->top_field = 1; |
369 | } else { | 374 | } else |
370 | buf->top_field = 0; | 375 | buf->top_field = 0; |
371 | } | ||
372 | buf->receiving = 1; | 376 | buf->receiving = 1; |
373 | dma_q->pos = 0; | 377 | dma_q->pos = 0; |
374 | } else if (p[0]==0x33 && p[1]==0x95 && p[2]==0x00) { | 378 | } else if (p[0] == 0x33 && p[1] == 0x95 && p[2] == 0x00) { |
375 | em28xx_isocdbg("VBI HEADER!!!\n"); | 379 | em28xx_isocdbg("VBI HEADER!!!\n"); |
376 | } | 380 | } |
377 | 381 | ||
@@ -393,13 +397,13 @@ static void em28xx_irq_callback(struct urb *urb) | |||
393 | { | 397 | { |
394 | struct em28xx_dmaqueue *dma_q = urb->context; | 398 | struct em28xx_dmaqueue *dma_q = urb->context; |
395 | struct em28xx *dev = container_of(dma_q, struct em28xx, vidq); | 399 | struct em28xx *dev = container_of(dma_q, struct em28xx, vidq); |
396 | int rc,i; | 400 | int rc, i; |
397 | unsigned long flags; | 401 | unsigned long flags; |
398 | 402 | ||
399 | spin_lock_irqsave(&dev->slock,flags); | 403 | spin_lock_irqsave(&dev->slock, flags); |
400 | 404 | ||
401 | /* Copy data from URB */ | 405 | /* Copy data from URB */ |
402 | rc=em28xx_isoc_copy(urb); | 406 | rc = em28xx_isoc_copy(urb); |
403 | 407 | ||
404 | /* Reset urb buffers */ | 408 | /* Reset urb buffers */ |
405 | for (i = 0; i < urb->number_of_packets; i++) { | 409 | for (i = 0; i < urb->number_of_packets; i++) { |
@@ -408,12 +412,13 @@ static void em28xx_irq_callback(struct urb *urb) | |||
408 | } | 412 | } |
409 | urb->status = 0; | 413 | urb->status = 0; |
410 | 414 | ||
411 | if ((urb->status = usb_submit_urb(urb, GFP_ATOMIC))) { | 415 | urb->status = usb_submit_urb(urb, GFP_ATOMIC); |
416 | if (urb->status) { | ||
412 | em28xx_err("urb resubmit failed (error=%i)\n", | 417 | em28xx_err("urb resubmit failed (error=%i)\n", |
413 | urb->status); | 418 | urb->status); |
414 | } | 419 | } |
415 | 420 | ||
416 | spin_unlock_irqrestore(&dev->slock,flags); | 421 | spin_unlock_irqrestore(&dev->slock, flags); |
417 | } | 422 | } |
418 | 423 | ||
419 | /* | 424 | /* |
@@ -426,10 +431,10 @@ static void em28xx_uninit_isoc(struct em28xx *dev) | |||
426 | 431 | ||
427 | em28xx_isocdbg("em28xx: called em28xx_uninit_isoc\n"); | 432 | em28xx_isocdbg("em28xx: called em28xx_uninit_isoc\n"); |
428 | 433 | ||
429 | dev->isoc_ctl.nfields=-1; | 434 | dev->isoc_ctl.nfields = -1; |
430 | dev->isoc_ctl.buf=NULL; | 435 | dev->isoc_ctl.buf = NULL; |
431 | for (i = 0; i < dev->isoc_ctl.num_bufs; i++) { | 436 | for (i = 0; i < dev->isoc_ctl.num_bufs; i++) { |
432 | urb=dev->isoc_ctl.urb[i]; | 437 | urb = dev->isoc_ctl.urb[i]; |
433 | if (urb) { | 438 | if (urb) { |
434 | usb_kill_urb(urb); | 439 | usb_kill_urb(urb); |
435 | usb_unlink_urb(urb); | 440 | usb_unlink_urb(urb); |
@@ -445,12 +450,12 @@ static void em28xx_uninit_isoc(struct em28xx *dev) | |||
445 | dev->isoc_ctl.transfer_buffer[i] = NULL; | 450 | dev->isoc_ctl.transfer_buffer[i] = NULL; |
446 | } | 451 | } |
447 | 452 | ||
448 | kfree (dev->isoc_ctl.urb); | 453 | kfree(dev->isoc_ctl.urb); |
449 | kfree (dev->isoc_ctl.transfer_buffer); | 454 | kfree(dev->isoc_ctl.transfer_buffer); |
450 | dev->isoc_ctl.urb=NULL; | 455 | dev->isoc_ctl.urb = NULL; |
451 | dev->isoc_ctl.transfer_buffer=NULL; | 456 | dev->isoc_ctl.transfer_buffer = NULL; |
452 | 457 | ||
453 | dev->isoc_ctl.num_bufs=0; | 458 | dev->isoc_ctl.num_bufs = 0; |
454 | 459 | ||
455 | del_timer(&dev->vidq.timeout); | 460 | del_timer(&dev->vidq.timeout); |
456 | em28xx_capture_start(dev, 0); | 461 | em28xx_capture_start(dev, 0); |
@@ -507,7 +512,7 @@ static int em28xx_prepare_isoc(struct em28xx *dev, int max_packets, | |||
507 | dev->isoc_ctl.transfer_buffer[i] = usb_buffer_alloc(dev->udev, | 512 | dev->isoc_ctl.transfer_buffer[i] = usb_buffer_alloc(dev->udev, |
508 | sb_size, GFP_KERNEL, &urb->transfer_dma); | 513 | sb_size, GFP_KERNEL, &urb->transfer_dma); |
509 | if (!dev->isoc_ctl.transfer_buffer[i]) { | 514 | if (!dev->isoc_ctl.transfer_buffer[i]) { |
510 | em28xx_err ("unable to allocate %i bytes for transfer" | 515 | em28xx_err("unable to allocate %i bytes for transfer" |
511 | " buffer %i%s\n", | 516 | " buffer %i%s\n", |
512 | sb_size, i, | 517 | sb_size, i, |
513 | in_interrupt()?" while in int":""); | 518 | in_interrupt()?" while in int":""); |
@@ -520,7 +525,7 @@ static int em28xx_prepare_isoc(struct em28xx *dev, int max_packets, | |||
520 | 'desc.bEndpointAddress & USB_ENDPOINT_NUMBER_MASK' | 525 | 'desc.bEndpointAddress & USB_ENDPOINT_NUMBER_MASK' |
521 | should also be using 'desc.bInterval' | 526 | should also be using 'desc.bInterval' |
522 | */ | 527 | */ |
523 | pipe=usb_rcvisocpipe(dev->udev, 0x82); | 528 | pipe = usb_rcvisocpipe(dev->udev, 0x82); |
524 | usb_fill_int_urb(urb, dev->udev, pipe, | 529 | usb_fill_int_urb(urb, dev->udev, pipe, |
525 | dev->isoc_ctl.transfer_buffer[i], sb_size, | 530 | dev->isoc_ctl.transfer_buffer[i], sb_size, |
526 | em28xx_irq_callback, dma_q, 1); | 531 | em28xx_irq_callback, dma_q, 1); |
@@ -540,10 +545,10 @@ static int em28xx_prepare_isoc(struct em28xx *dev, int max_packets, | |||
540 | return 0; | 545 | return 0; |
541 | } | 546 | } |
542 | 547 | ||
543 | static int em28xx_start_thread( struct em28xx_dmaqueue *dma_q) | 548 | static int em28xx_start_thread(struct em28xx_dmaqueue *dma_q) |
544 | { | 549 | { |
545 | struct em28xx *dev = container_of(dma_q, struct em28xx, vidq); | 550 | struct em28xx *dev = container_of(dma_q, struct em28xx, vidq); |
546 | int i,rc = 0; | 551 | int i, rc = 0; |
547 | 552 | ||
548 | em28xx_videodbg("Called em28xx_start_thread\n"); | 553 | em28xx_videodbg("Called em28xx_start_thread\n"); |
549 | 554 | ||
@@ -562,7 +567,7 @@ static int em28xx_start_thread( struct em28xx_dmaqueue *dma_q) | |||
562 | } | 567 | } |
563 | } | 568 | } |
564 | 569 | ||
565 | if (rc<0) | 570 | if (rc < 0) |
566 | return rc; | 571 | return rc; |
567 | 572 | ||
568 | return 0; | 573 | return 0; |
@@ -570,12 +575,12 @@ static int em28xx_start_thread( struct em28xx_dmaqueue *dma_q) | |||
570 | 575 | ||
571 | static void em28xx_vid_timeout(unsigned long data) | 576 | static void em28xx_vid_timeout(unsigned long data) |
572 | { | 577 | { |
573 | struct em28xx *dev = (struct em28xx*)data; | 578 | struct em28xx *dev = (struct em28xx *)data; |
574 | struct em28xx_dmaqueue *vidq = &dev->vidq; | 579 | struct em28xx_dmaqueue *vidq = &dev->vidq; |
575 | struct em28xx_buffer *buf; | 580 | struct em28xx_buffer *buf; |
576 | unsigned long flags; | 581 | unsigned long flags; |
577 | 582 | ||
578 | spin_lock_irqsave(&dev->slock,flags); | 583 | spin_lock_irqsave(&dev->slock, flags); |
579 | 584 | ||
580 | list_for_each_entry(buf, vidq->active.next, vb.queue) { | 585 | list_for_each_entry(buf, vidq->active.next, vb.queue) { |
581 | list_del(&buf->vb.queue); | 586 | list_del(&buf->vb.queue); |
@@ -587,7 +592,7 @@ static void em28xx_vid_timeout(unsigned long data) | |||
587 | /* Instead of trying to restart, just sets timeout again */ | 592 | /* Instead of trying to restart, just sets timeout again */ |
588 | mod_timer(&vidq->timeout, jiffies + BUFFER_TIMEOUT); | 593 | mod_timer(&vidq->timeout, jiffies + BUFFER_TIMEOUT); |
589 | 594 | ||
590 | spin_unlock_irqrestore(&dev->slock,flags); | 595 | spin_unlock_irqrestore(&dev->slock, flags); |
591 | } | 596 | } |
592 | 597 | ||
593 | /* ------------------------------------------------------------------ | 598 | /* ------------------------------------------------------------------ |
@@ -603,9 +608,8 @@ buffer_setup(struct videobuf_queue *vq, unsigned int *count, unsigned int *size) | |||
603 | if (0 == *count) | 608 | if (0 == *count) |
604 | *count = EM28XX_DEF_BUF; | 609 | *count = EM28XX_DEF_BUF; |
605 | 610 | ||
606 | if (*count < EM28XX_MIN_BUF) { | 611 | if (*count < EM28XX_MIN_BUF) |
607 | *count=EM28XX_MIN_BUF; | 612 | *count = EM28XX_MIN_BUF; |
608 | } | ||
609 | 613 | ||
610 | return 0; | 614 | return 0; |
611 | } | 615 | } |
@@ -625,7 +629,7 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb, | |||
625 | enum v4l2_field field) | 629 | enum v4l2_field field) |
626 | { | 630 | { |
627 | struct em28xx_fh *fh = vq->priv_data; | 631 | struct em28xx_fh *fh = vq->priv_data; |
628 | struct em28xx_buffer *buf = container_of(vb,struct em28xx_buffer,vb); | 632 | struct em28xx_buffer *buf = container_of(vb, struct em28xx_buffer, vb); |
629 | struct em28xx *dev = fh->dev; | 633 | struct em28xx *dev = fh->dev; |
630 | struct em28xx_dmaqueue *vidq = &dev->vidq; | 634 | struct em28xx_dmaqueue *vidq = &dev->vidq; |
631 | int rc = 0, urb_init = 0; | 635 | int rc = 0, urb_init = 0; |
@@ -657,15 +661,16 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb, | |||
657 | } | 661 | } |
658 | 662 | ||
659 | if (!dev->isoc_ctl.num_bufs) | 663 | if (!dev->isoc_ctl.num_bufs) |
660 | urb_init=1; | 664 | urb_init = 1; |
661 | 665 | ||
662 | if (urb_init) { | 666 | if (urb_init) { |
663 | rc = em28xx_prepare_isoc(dev, EM28XX_NUM_PACKETS, EM28XX_NUM_BUFS); | 667 | rc = em28xx_prepare_isoc(dev, EM28XX_NUM_PACKETS, |
664 | if (rc<0) | 668 | EM28XX_NUM_BUFS); |
669 | if (rc < 0) | ||
665 | goto fail; | 670 | goto fail; |
666 | 671 | ||
667 | rc = em28xx_start_thread(vidq); | 672 | rc = em28xx_start_thread(vidq); |
668 | if (rc<0) | 673 | if (rc < 0) |
669 | goto fail; | 674 | goto fail; |
670 | } | 675 | } |
671 | 676 | ||
@@ -673,7 +678,7 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb, | |||
673 | return 0; | 678 | return 0; |
674 | 679 | ||
675 | fail: | 680 | fail: |
676 | free_buffer(vq,buf); | 681 | free_buffer(vq, buf); |
677 | return rc; | 682 | return rc; |
678 | } | 683 | } |
679 | 684 | ||
@@ -682,7 +687,7 @@ buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb) | |||
682 | { | 687 | { |
683 | struct em28xx_buffer *buf = container_of(vb, struct em28xx_buffer, vb); | 688 | struct em28xx_buffer *buf = container_of(vb, struct em28xx_buffer, vb); |
684 | struct em28xx_fh *fh = vq->priv_data; | 689 | struct em28xx_fh *fh = vq->priv_data; |
685 | struct em28xx *dev = fh->dev; | 690 | struct em28xx *dev = fh->dev; |
686 | struct em28xx_dmaqueue *vidq = &dev->vidq; | 691 | struct em28xx_dmaqueue *vidq = &dev->vidq; |
687 | 692 | ||
688 | buf->vb.state = VIDEOBUF_QUEUED; | 693 | buf->vb.state = VIDEOBUF_QUEUED; |
@@ -692,13 +697,13 @@ buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb) | |||
692 | 697 | ||
693 | static void buffer_release(struct videobuf_queue *vq, struct videobuf_buffer *vb) | 698 | static void buffer_release(struct videobuf_queue *vq, struct videobuf_buffer *vb) |
694 | { | 699 | { |
695 | struct em28xx_buffer *buf = container_of(vb,struct em28xx_buffer,vb); | 700 | struct em28xx_buffer *buf = container_of(vb, struct em28xx_buffer, vb); |
696 | struct em28xx_fh *fh = vq->priv_data; | 701 | struct em28xx_fh *fh = vq->priv_data; |
697 | struct em28xx *dev = (struct em28xx*)fh->dev; | 702 | struct em28xx *dev = (struct em28xx *)fh->dev; |
698 | 703 | ||
699 | em28xx_isocdbg("em28xx: called buffer_release\n"); | 704 | em28xx_isocdbg("em28xx: called buffer_release\n"); |
700 | 705 | ||
701 | free_buffer(vq,buf); | 706 | free_buffer(vq, buf); |
702 | } | 707 | } |
703 | 708 | ||
704 | static struct videobuf_queue_ops em28xx_video_qops = { | 709 | static struct videobuf_queue_ops em28xx_video_qops = { |
@@ -1589,11 +1594,11 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b) | |||
1589 | } | 1594 | } |
1590 | 1595 | ||
1591 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | 1596 | #ifdef CONFIG_VIDEO_V4L1_COMPAT |
1592 | static int vidiocgmbuf (struct file *file, void *priv, struct video_mbuf *mbuf) | 1597 | static int vidiocgmbuf(struct file *file, void *priv, struct video_mbuf *mbuf) |
1593 | { | 1598 | { |
1594 | struct em28xx_fh *fh=priv; | 1599 | struct em28xx_fh *fh = priv; |
1595 | 1600 | ||
1596 | return videobuf_cgmbuf (&fh->vb_vidq, mbuf, 8); | 1601 | return videobuf_cgmbuf(&fh->vb_vidq, mbuf, 8); |
1597 | } | 1602 | } |
1598 | #endif | 1603 | #endif |
1599 | 1604 | ||
@@ -1865,7 +1870,7 @@ static int em28xx_v4l2_close(struct inode *inode, struct file *filp) | |||
1865 | */ | 1870 | */ |
1866 | static ssize_t | 1871 | static ssize_t |
1867 | em28xx_v4l2_read(struct file *filp, char __user * buf, size_t count, | 1872 | em28xx_v4l2_read(struct file *filp, char __user * buf, size_t count, |
1868 | loff_t * pos) | 1873 | loff_t *pos) |
1869 | { | 1874 | { |
1870 | struct em28xx_fh *fh = filp->private_data; | 1875 | struct em28xx_fh *fh = filp->private_data; |
1871 | struct em28xx *dev = fh->dev; | 1876 | struct em28xx *dev = fh->dev; |