aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l1-compat.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-12-30 05:04:34 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-01-02 14:11:34 -0500
commit069b747931f13eda289c1d59a09ecc8162281a76 (patch)
tree144b8ebf131eba4f3468d8d3f52bd192bc2e4f76 /drivers/media/video/v4l1-compat.c
parent4ab9203b1b7e45f1beae7eb0c67d663a26257a69 (diff)
V4L/DVB (10138): v4l2-ioctl: change to long return type to match unlocked_ioctl.
Since internal to v4l2 the ioctl prototype is the same regardless of it being called through .ioctl or .unlocked_ioctl, we need to convert it all to the long return type of unlocked_ioctl. Thanks to Jean-Francois Moine for posting an initial patch for this and thus bringing it to our attention. Cc: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l1-compat.c')
-rw-r--r--drivers/media/video/v4l1-compat.c164
1 files changed, 83 insertions, 81 deletions
diff --git a/drivers/media/video/v4l1-compat.c b/drivers/media/video/v4l1-compat.c
index f13c0a9d684f..d450cab20be4 100644
--- a/drivers/media/video/v4l1-compat.c
+++ b/drivers/media/video/v4l1-compat.c
@@ -267,12 +267,12 @@ done:
267 267
268/* ----------------------------------------------------------------- */ 268/* ----------------------------------------------------------------- */
269 269
270static noinline int v4l1_compat_get_capabilities( 270static noinline long v4l1_compat_get_capabilities(
271 struct video_capability *cap, 271 struct video_capability *cap,
272 struct file *file, 272 struct file *file,
273 v4l2_kioctl drv) 273 v4l2_kioctl drv)
274{ 274{
275 int err; 275 long err;
276 struct v4l2_framebuffer fbuf; 276 struct v4l2_framebuffer fbuf;
277 struct v4l2_capability *cap2; 277 struct v4l2_capability *cap2;
278 278
@@ -286,13 +286,13 @@ static noinline int v4l1_compat_get_capabilities(
286 286
287 err = drv(file, VIDIOC_QUERYCAP, cap2); 287 err = drv(file, VIDIOC_QUERYCAP, cap2);
288 if (err < 0) { 288 if (err < 0) {
289 dprintk("VIDIOCGCAP / VIDIOC_QUERYCAP: %d\n", err); 289 dprintk("VIDIOCGCAP / VIDIOC_QUERYCAP: %ld\n", err);
290 goto done; 290 goto done;
291 } 291 }
292 if (cap2->capabilities & V4L2_CAP_VIDEO_OVERLAY) { 292 if (cap2->capabilities & V4L2_CAP_VIDEO_OVERLAY) {
293 err = drv(file, VIDIOC_G_FBUF, &fbuf); 293 err = drv(file, VIDIOC_G_FBUF, &fbuf);
294 if (err < 0) { 294 if (err < 0) {
295 dprintk("VIDIOCGCAP / VIDIOC_G_FBUF: %d\n", err); 295 dprintk("VIDIOCGCAP / VIDIOC_G_FBUF: %ld\n", err);
296 memset(&fbuf, 0, sizeof(fbuf)); 296 memset(&fbuf, 0, sizeof(fbuf));
297 } 297 }
298 err = 0; 298 err = 0;
@@ -324,12 +324,12 @@ done:
324 return err; 324 return err;
325} 325}
326 326
327static noinline int v4l1_compat_get_frame_buffer( 327static noinline long v4l1_compat_get_frame_buffer(
328 struct video_buffer *buffer, 328 struct video_buffer *buffer,
329 struct file *file, 329 struct file *file,
330 v4l2_kioctl drv) 330 v4l2_kioctl drv)
331{ 331{
332 int err; 332 long err;
333 struct v4l2_framebuffer fbuf; 333 struct v4l2_framebuffer fbuf;
334 334
335 memset(buffer, 0, sizeof(*buffer)); 335 memset(buffer, 0, sizeof(*buffer));
@@ -337,7 +337,7 @@ static noinline int v4l1_compat_get_frame_buffer(
337 337
338 err = drv(file, VIDIOC_G_FBUF, &fbuf); 338 err = drv(file, VIDIOC_G_FBUF, &fbuf);
339 if (err < 0) { 339 if (err < 0) {
340 dprintk("VIDIOCGFBUF / VIDIOC_G_FBUF: %d\n", err); 340 dprintk("VIDIOCGFBUF / VIDIOC_G_FBUF: %ld\n", err);
341 goto done; 341 goto done;
342 } 342 }
343 buffer->base = fbuf.base; 343 buffer->base = fbuf.base;
@@ -378,12 +378,12 @@ done:
378 return err; 378 return err;
379} 379}
380 380
381static noinline int v4l1_compat_set_frame_buffer( 381static noinline long v4l1_compat_set_frame_buffer(
382 struct video_buffer *buffer, 382 struct video_buffer *buffer,
383 struct file *file, 383 struct file *file,
384 v4l2_kioctl drv) 384 v4l2_kioctl drv)
385{ 385{
386 int err; 386 long err;
387 struct v4l2_framebuffer fbuf; 387 struct v4l2_framebuffer fbuf;
388 388
389 memset(&fbuf, 0, sizeof(fbuf)); 389 memset(&fbuf, 0, sizeof(fbuf));
@@ -410,16 +410,16 @@ static noinline int v4l1_compat_set_frame_buffer(
410 fbuf.fmt.bytesperline = buffer->bytesperline; 410 fbuf.fmt.bytesperline = buffer->bytesperline;
411 err = drv(file, VIDIOC_S_FBUF, &fbuf); 411 err = drv(file, VIDIOC_S_FBUF, &fbuf);
412 if (err < 0) 412 if (err < 0)
413 dprintk("VIDIOCSFBUF / VIDIOC_S_FBUF: %d\n", err); 413 dprintk("VIDIOCSFBUF / VIDIOC_S_FBUF: %ld\n", err);
414 return err; 414 return err;
415} 415}
416 416
417static noinline int v4l1_compat_get_win_cap_dimensions( 417static noinline long v4l1_compat_get_win_cap_dimensions(
418 struct video_window *win, 418 struct video_window *win,
419 struct file *file, 419 struct file *file,
420 v4l2_kioctl drv) 420 v4l2_kioctl drv)
421{ 421{
422 int err; 422 long err;
423 struct v4l2_format *fmt; 423 struct v4l2_format *fmt;
424 424
425 fmt = kzalloc(sizeof(*fmt), GFP_KERNEL); 425 fmt = kzalloc(sizeof(*fmt), GFP_KERNEL);
@@ -432,7 +432,7 @@ static noinline int v4l1_compat_get_win_cap_dimensions(
432 fmt->type = V4L2_BUF_TYPE_VIDEO_OVERLAY; 432 fmt->type = V4L2_BUF_TYPE_VIDEO_OVERLAY;
433 err = drv(file, VIDIOC_G_FMT, fmt); 433 err = drv(file, VIDIOC_G_FMT, fmt);
434 if (err < 0) 434 if (err < 0)
435 dprintk("VIDIOCGWIN / VIDIOC_G_WIN: %d\n", err); 435 dprintk("VIDIOCGWIN / VIDIOC_G_WIN: %ld\n", err);
436 if (err == 0) { 436 if (err == 0) {
437 win->x = fmt->fmt.win.w.left; 437 win->x = fmt->fmt.win.w.left;
438 win->y = fmt->fmt.win.w.top; 438 win->y = fmt->fmt.win.w.top;
@@ -447,7 +447,7 @@ static noinline int v4l1_compat_get_win_cap_dimensions(
447 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 447 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
448 err = drv(file, VIDIOC_G_FMT, fmt); 448 err = drv(file, VIDIOC_G_FMT, fmt);
449 if (err < 0) { 449 if (err < 0) {
450 dprintk("VIDIOCGWIN / VIDIOC_G_FMT: %d\n", err); 450 dprintk("VIDIOCGWIN / VIDIOC_G_FMT: %ld\n", err);
451 goto done; 451 goto done;
452 } 452 }
453 win->x = 0; 453 win->x = 0;
@@ -462,12 +462,12 @@ done:
462 return err; 462 return err;
463} 463}
464 464
465static noinline int v4l1_compat_set_win_cap_dimensions( 465static noinline long v4l1_compat_set_win_cap_dimensions(
466 struct video_window *win, 466 struct video_window *win,
467 struct file *file, 467 struct file *file,
468 v4l2_kioctl drv) 468 v4l2_kioctl drv)
469{ 469{
470 int err, err1, err2; 470 long err, err1, err2;
471 struct v4l2_format *fmt; 471 struct v4l2_format *fmt;
472 472
473 fmt = kzalloc(sizeof(*fmt), GFP_KERNEL); 473 fmt = kzalloc(sizeof(*fmt), GFP_KERNEL);
@@ -479,7 +479,7 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
479 drv(file, VIDIOC_STREAMOFF, &fmt->type); 479 drv(file, VIDIOC_STREAMOFF, &fmt->type);
480 err1 = drv(file, VIDIOC_G_FMT, fmt); 480 err1 = drv(file, VIDIOC_G_FMT, fmt);
481 if (err1 < 0) 481 if (err1 < 0)
482 dprintk("VIDIOCSWIN / VIDIOC_G_FMT: %d\n", err1); 482 dprintk("VIDIOCSWIN / VIDIOC_G_FMT: %ld\n", err1);
483 if (err1 == 0) { 483 if (err1 == 0) {
484 fmt->fmt.pix.width = win->width; 484 fmt->fmt.pix.width = win->width;
485 fmt->fmt.pix.height = win->height; 485 fmt->fmt.pix.height = win->height;
@@ -487,7 +487,7 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
487 fmt->fmt.pix.bytesperline = 0; 487 fmt->fmt.pix.bytesperline = 0;
488 err = drv(file, VIDIOC_S_FMT, fmt); 488 err = drv(file, VIDIOC_S_FMT, fmt);
489 if (err < 0) 489 if (err < 0)
490 dprintk("VIDIOCSWIN / VIDIOC_S_FMT #1: %d\n", 490 dprintk("VIDIOCSWIN / VIDIOC_S_FMT #1: %ld\n",
491 err); 491 err);
492 win->width = fmt->fmt.pix.width; 492 win->width = fmt->fmt.pix.width;
493 win->height = fmt->fmt.pix.height; 493 win->height = fmt->fmt.pix.height;
@@ -504,7 +504,7 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
504 fmt->fmt.win.clipcount = win->clipcount; 504 fmt->fmt.win.clipcount = win->clipcount;
505 err2 = drv(file, VIDIOC_S_FMT, fmt); 505 err2 = drv(file, VIDIOC_S_FMT, fmt);
506 if (err2 < 0) 506 if (err2 < 0)
507 dprintk("VIDIOCSWIN / VIDIOC_S_FMT #2: %d\n", err2); 507 dprintk("VIDIOCSWIN / VIDIOC_S_FMT #2: %ld\n", err2);
508 508
509 if (err1 != 0 && err2 != 0) 509 if (err1 != 0 && err2 != 0)
510 err = err1; 510 err = err1;
@@ -514,12 +514,12 @@ static noinline int v4l1_compat_set_win_cap_dimensions(
514 return err; 514 return err;
515} 515}
516 516
517static noinline int v4l1_compat_turn_preview_on_off( 517static noinline long v4l1_compat_turn_preview_on_off(
518 int *on, 518 int *on,
519 struct file *file, 519 struct file *file,
520 v4l2_kioctl drv) 520 v4l2_kioctl drv)
521{ 521{
522 int err; 522 long err;
523 enum v4l2_buf_type captype = V4L2_BUF_TYPE_VIDEO_CAPTURE; 523 enum v4l2_buf_type captype = V4L2_BUF_TYPE_VIDEO_CAPTURE;
524 524
525 if (0 == *on) { 525 if (0 == *on) {
@@ -530,16 +530,16 @@ static noinline int v4l1_compat_turn_preview_on_off(
530 } 530 }
531 err = drv(file, VIDIOC_OVERLAY, on); 531 err = drv(file, VIDIOC_OVERLAY, on);
532 if (err < 0) 532 if (err < 0)
533 dprintk("VIDIOCCAPTURE / VIDIOC_PREVIEW: %d\n", err); 533 dprintk("VIDIOCCAPTURE / VIDIOC_PREVIEW: %ld\n", err);
534 return err; 534 return err;
535} 535}
536 536
537static noinline int v4l1_compat_get_input_info( 537static noinline long v4l1_compat_get_input_info(
538 struct video_channel *chan, 538 struct video_channel *chan,
539 struct file *file, 539 struct file *file,
540 v4l2_kioctl drv) 540 v4l2_kioctl drv)
541{ 541{
542 int err; 542 long err;
543 struct v4l2_input input2; 543 struct v4l2_input input2;
544 v4l2_std_id sid; 544 v4l2_std_id sid;
545 545
@@ -548,7 +548,7 @@ static noinline int v4l1_compat_get_input_info(
548 err = drv(file, VIDIOC_ENUMINPUT, &input2); 548 err = drv(file, VIDIOC_ENUMINPUT, &input2);
549 if (err < 0) { 549 if (err < 0) {
550 dprintk("VIDIOCGCHAN / VIDIOC_ENUMINPUT: " 550 dprintk("VIDIOCGCHAN / VIDIOC_ENUMINPUT: "
551 "channel=%d err=%d\n", chan->channel, err); 551 "channel=%d err=%ld\n", chan->channel, err);
552 goto done; 552 goto done;
553 } 553 }
554 chan->channel = input2.index; 554 chan->channel = input2.index;
@@ -569,7 +569,7 @@ static noinline int v4l1_compat_get_input_info(
569 chan->norm = 0; 569 chan->norm = 0;
570 err = drv(file, VIDIOC_G_STD, &sid); 570 err = drv(file, VIDIOC_G_STD, &sid);
571 if (err < 0) 571 if (err < 0)
572 dprintk("VIDIOCGCHAN / VIDIOC_G_STD: %d\n", err); 572 dprintk("VIDIOCGCHAN / VIDIOC_G_STD: %ld\n", err);
573 if (err == 0) { 573 if (err == 0) {
574 if (sid & V4L2_STD_PAL) 574 if (sid & V4L2_STD_PAL)
575 chan->norm = VIDEO_MODE_PAL; 575 chan->norm = VIDEO_MODE_PAL;
@@ -582,17 +582,17 @@ done:
582 return err; 582 return err;
583} 583}
584 584
585static noinline int v4l1_compat_set_input( 585static noinline long v4l1_compat_set_input(
586 struct video_channel *chan, 586 struct video_channel *chan,
587 struct file *file, 587 struct file *file,
588 v4l2_kioctl drv) 588 v4l2_kioctl drv)
589{ 589{
590 int err; 590 long err;
591 v4l2_std_id sid = 0; 591 v4l2_std_id sid = 0;
592 592
593 err = drv(file, VIDIOC_S_INPUT, &chan->channel); 593 err = drv(file, VIDIOC_S_INPUT, &chan->channel);
594 if (err < 0) 594 if (err < 0)
595 dprintk("VIDIOCSCHAN / VIDIOC_S_INPUT: %d\n", err); 595 dprintk("VIDIOCSCHAN / VIDIOC_S_INPUT: %ld\n", err);
596 switch (chan->norm) { 596 switch (chan->norm) {
597 case VIDEO_MODE_PAL: 597 case VIDEO_MODE_PAL:
598 sid = V4L2_STD_PAL; 598 sid = V4L2_STD_PAL;
@@ -607,17 +607,17 @@ static noinline int v4l1_compat_set_input(
607 if (0 != sid) { 607 if (0 != sid) {
608 err = drv(file, VIDIOC_S_STD, &sid); 608 err = drv(file, VIDIOC_S_STD, &sid);
609 if (err < 0) 609 if (err < 0)
610 dprintk("VIDIOCSCHAN / VIDIOC_S_STD: %d\n", err); 610 dprintk("VIDIOCSCHAN / VIDIOC_S_STD: %ld\n", err);
611 } 611 }
612 return err; 612 return err;
613} 613}
614 614
615static noinline int v4l1_compat_get_picture( 615static noinline long v4l1_compat_get_picture(
616 struct video_picture *pict, 616 struct video_picture *pict,
617 struct file *file, 617 struct file *file,
618 v4l2_kioctl drv) 618 v4l2_kioctl drv)
619{ 619{
620 int err; 620 long err;
621 struct v4l2_format *fmt; 621 struct v4l2_format *fmt;
622 622
623 fmt = kzalloc(sizeof(*fmt), GFP_KERNEL); 623 fmt = kzalloc(sizeof(*fmt), GFP_KERNEL);
@@ -640,7 +640,7 @@ static noinline int v4l1_compat_get_picture(
640 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 640 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
641 err = drv(file, VIDIOC_G_FMT, fmt); 641 err = drv(file, VIDIOC_G_FMT, fmt);
642 if (err < 0) { 642 if (err < 0) {
643 dprintk("VIDIOCGPICT / VIDIOC_G_FMT: %d\n", err); 643 dprintk("VIDIOCGPICT / VIDIOC_G_FMT: %ld\n", err);
644 goto done; 644 goto done;
645 } 645 }
646 646
@@ -654,12 +654,12 @@ done:
654 return err; 654 return err;
655} 655}
656 656
657static noinline int v4l1_compat_set_picture( 657static noinline long v4l1_compat_set_picture(
658 struct video_picture *pict, 658 struct video_picture *pict,
659 struct file *file, 659 struct file *file,
660 v4l2_kioctl drv) 660 v4l2_kioctl drv)
661{ 661{
662 int err; 662 long err;
663 struct v4l2_framebuffer fbuf; 663 struct v4l2_framebuffer fbuf;
664 int mem_err = 0, ovl_err = 0; 664 int mem_err = 0, ovl_err = 0;
665 struct v4l2_format *fmt; 665 struct v4l2_format *fmt;
@@ -694,7 +694,7 @@ static noinline int v4l1_compat_set_picture(
694 support memory capture. Trying to set the memory capture 694 support memory capture. Trying to set the memory capture
695 parameters would be pointless. */ 695 parameters would be pointless. */
696 if (err < 0) { 696 if (err < 0) {
697 dprintk("VIDIOCSPICT / VIDIOC_G_FMT: %d\n", err); 697 dprintk("VIDIOCSPICT / VIDIOC_G_FMT: %ld\n", err);
698 mem_err = -1000; /* didn't even try */ 698 mem_err = -1000; /* didn't even try */
699 } else if (fmt->fmt.pix.pixelformat != 699 } else if (fmt->fmt.pix.pixelformat !=
700 palette_to_pixelformat(pict->palette)) { 700 palette_to_pixelformat(pict->palette)) {
@@ -711,7 +711,7 @@ static noinline int v4l1_compat_set_picture(
711 support overlay. Trying to set the overlay parameters 711 support overlay. Trying to set the overlay parameters
712 would be quite pointless. */ 712 would be quite pointless. */
713 if (err < 0) { 713 if (err < 0) {
714 dprintk("VIDIOCSPICT / VIDIOC_G_FBUF: %d\n", err); 714 dprintk("VIDIOCSPICT / VIDIOC_G_FBUF: %ld\n", err);
715 ovl_err = -1000; /* didn't even try */ 715 ovl_err = -1000; /* didn't even try */
716 } else if (fbuf.fmt.pixelformat != 716 } else if (fbuf.fmt.pixelformat !=
717 palette_to_pixelformat(pict->palette)) { 717 palette_to_pixelformat(pict->palette)) {
@@ -736,12 +736,13 @@ static noinline int v4l1_compat_set_picture(
736 return err; 736 return err;
737} 737}
738 738
739static noinline int v4l1_compat_get_tuner( 739static noinline long v4l1_compat_get_tuner(
740 struct video_tuner *tun, 740 struct video_tuner *tun,
741 struct file *file, 741 struct file *file,
742 v4l2_kioctl drv) 742 v4l2_kioctl drv)
743{ 743{
744 int err, i; 744 long err;
745 int i;
745 struct v4l2_tuner tun2; 746 struct v4l2_tuner tun2;
746 struct v4l2_standard std2; 747 struct v4l2_standard std2;
747 v4l2_std_id sid; 748 v4l2_std_id sid;
@@ -749,7 +750,7 @@ static noinline int v4l1_compat_get_tuner(
749 memset(&tun2, 0, sizeof(tun2)); 750 memset(&tun2, 0, sizeof(tun2));
750 err = drv(file, VIDIOC_G_TUNER, &tun2); 751 err = drv(file, VIDIOC_G_TUNER, &tun2);
751 if (err < 0) { 752 if (err < 0) {
752 dprintk("VIDIOCGTUNER / VIDIOC_G_TUNER: %d\n", err); 753 dprintk("VIDIOCGTUNER / VIDIOC_G_TUNER: %ld\n", err);
753 goto done; 754 goto done;
754 } 755 }
755 memcpy(tun->name, tun2.name, 756 memcpy(tun->name, tun2.name,
@@ -775,7 +776,7 @@ static noinline int v4l1_compat_get_tuner(
775 776
776 err = drv(file, VIDIOC_G_STD, &sid); 777 err = drv(file, VIDIOC_G_STD, &sid);
777 if (err < 0) 778 if (err < 0)
778 dprintk("VIDIOCGTUNER / VIDIOC_G_STD: %d\n", err); 779 dprintk("VIDIOCGTUNER / VIDIOC_G_STD: %ld\n", err);
779 if (err == 0) { 780 if (err == 0) {
780 if (sid & V4L2_STD_PAL) 781 if (sid & V4L2_STD_PAL)
781 tun->mode = VIDEO_MODE_PAL; 782 tun->mode = VIDEO_MODE_PAL;
@@ -794,12 +795,12 @@ done:
794 return err; 795 return err;
795} 796}
796 797
797static noinline int v4l1_compat_select_tuner( 798static noinline long v4l1_compat_select_tuner(
798 struct video_tuner *tun, 799 struct video_tuner *tun,
799 struct file *file, 800 struct file *file,
800 v4l2_kioctl drv) 801 v4l2_kioctl drv)
801{ 802{
802 int err; 803 long err;
803 struct v4l2_tuner t;/*84 bytes on x86_64*/ 804 struct v4l2_tuner t;/*84 bytes on x86_64*/
804 memset(&t, 0, sizeof(t)); 805 memset(&t, 0, sizeof(t));
805 806
@@ -807,34 +808,34 @@ static noinline int v4l1_compat_select_tuner(
807 808
808 err = drv(file, VIDIOC_S_INPUT, &t); 809 err = drv(file, VIDIOC_S_INPUT, &t);
809 if (err < 0) 810 if (err < 0)
810 dprintk("VIDIOCSTUNER / VIDIOC_S_INPUT: %d\n", err); 811 dprintk("VIDIOCSTUNER / VIDIOC_S_INPUT: %ld\n", err);
811 return err; 812 return err;
812} 813}
813 814
814static noinline int v4l1_compat_get_frequency( 815static noinline long v4l1_compat_get_frequency(
815 unsigned long *freq, 816 unsigned long *freq,
816 struct file *file, 817 struct file *file,
817 v4l2_kioctl drv) 818 v4l2_kioctl drv)
818{ 819{
819 int err; 820 long err;
820 struct v4l2_frequency freq2; 821 struct v4l2_frequency freq2;
821 memset(&freq2, 0, sizeof(freq2)); 822 memset(&freq2, 0, sizeof(freq2));
822 823
823 freq2.tuner = 0; 824 freq2.tuner = 0;
824 err = drv(file, VIDIOC_G_FREQUENCY, &freq2); 825 err = drv(file, VIDIOC_G_FREQUENCY, &freq2);
825 if (err < 0) 826 if (err < 0)
826 dprintk("VIDIOCGFREQ / VIDIOC_G_FREQUENCY: %d\n", err); 827 dprintk("VIDIOCGFREQ / VIDIOC_G_FREQUENCY: %ld\n", err);
827 if (0 == err) 828 if (0 == err)
828 *freq = freq2.frequency; 829 *freq = freq2.frequency;
829 return err; 830 return err;
830} 831}
831 832
832static noinline int v4l1_compat_set_frequency( 833static noinline long v4l1_compat_set_frequency(
833 unsigned long *freq, 834 unsigned long *freq,
834 struct file *file, 835 struct file *file,
835 v4l2_kioctl drv) 836 v4l2_kioctl drv)
836{ 837{
837 int err; 838 long err;
838 struct v4l2_frequency freq2; 839 struct v4l2_frequency freq2;
839 memset(&freq2, 0, sizeof(freq2)); 840 memset(&freq2, 0, sizeof(freq2));
840 841
@@ -842,16 +843,17 @@ static noinline int v4l1_compat_set_frequency(
842 freq2.frequency = *freq; 843 freq2.frequency = *freq;
843 err = drv(file, VIDIOC_S_FREQUENCY, &freq2); 844 err = drv(file, VIDIOC_S_FREQUENCY, &freq2);
844 if (err < 0) 845 if (err < 0)
845 dprintk("VIDIOCSFREQ / VIDIOC_S_FREQUENCY: %d\n", err); 846 dprintk("VIDIOCSFREQ / VIDIOC_S_FREQUENCY: %ld\n", err);
846 return err; 847 return err;
847} 848}
848 849
849static noinline int v4l1_compat_get_audio( 850static noinline long v4l1_compat_get_audio(
850 struct video_audio *aud, 851 struct video_audio *aud,
851 struct file *file, 852 struct file *file,
852 v4l2_kioctl drv) 853 v4l2_kioctl drv)
853{ 854{
854 int err, i; 855 long err;
856 int i;
855 struct v4l2_queryctrl qctrl2; 857 struct v4l2_queryctrl qctrl2;
856 struct v4l2_audio aud2; 858 struct v4l2_audio aud2;
857 struct v4l2_tuner tun2; 859 struct v4l2_tuner tun2;
@@ -859,7 +861,7 @@ static noinline int v4l1_compat_get_audio(
859 861
860 err = drv(file, VIDIOC_G_AUDIO, &aud2); 862 err = drv(file, VIDIOC_G_AUDIO, &aud2);
861 if (err < 0) { 863 if (err < 0) {
862 dprintk("VIDIOCGAUDIO / VIDIOC_G_AUDIO: %d\n", err); 864 dprintk("VIDIOCGAUDIO / VIDIOC_G_AUDIO: %ld\n", err);
863 goto done; 865 goto done;
864 } 866 }
865 memcpy(aud->name, aud2.name, 867 memcpy(aud->name, aud2.name,
@@ -903,7 +905,7 @@ static noinline int v4l1_compat_get_audio(
903 memset(&tun2, 0, sizeof(tun2)); 905 memset(&tun2, 0, sizeof(tun2));
904 err = drv(file, VIDIOC_G_TUNER, &tun2); 906 err = drv(file, VIDIOC_G_TUNER, &tun2);
905 if (err < 0) { 907 if (err < 0) {
906 dprintk("VIDIOCGAUDIO / VIDIOC_G_TUNER: %d\n", err); 908 dprintk("VIDIOCGAUDIO / VIDIOC_G_TUNER: %ld\n", err);
907 err = 0; 909 err = 0;
908 goto done; 910 goto done;
909 } 911 }
@@ -918,12 +920,12 @@ done:
918 return err; 920 return err;
919} 921}
920 922
921static noinline int v4l1_compat_set_audio( 923static noinline long v4l1_compat_set_audio(
922 struct video_audio *aud, 924 struct video_audio *aud,
923 struct file *file, 925 struct file *file,
924 v4l2_kioctl drv) 926 v4l2_kioctl drv)
925{ 927{
926 int err; 928 long err;
927 struct v4l2_audio aud2; 929 struct v4l2_audio aud2;
928 struct v4l2_tuner tun2; 930 struct v4l2_tuner tun2;
929 931
@@ -933,7 +935,7 @@ static noinline int v4l1_compat_set_audio(
933 aud2.index = aud->audio; 935 aud2.index = aud->audio;
934 err = drv(file, VIDIOC_S_AUDIO, &aud2); 936 err = drv(file, VIDIOC_S_AUDIO, &aud2);
935 if (err < 0) { 937 if (err < 0) {
936 dprintk("VIDIOCSAUDIO / VIDIOC_S_AUDIO: %d\n", err); 938 dprintk("VIDIOCSAUDIO / VIDIOC_S_AUDIO: %ld\n", err);
937 goto done; 939 goto done;
938 } 940 }
939 941
@@ -950,7 +952,7 @@ static noinline int v4l1_compat_set_audio(
950 952
951 err = drv(file, VIDIOC_G_TUNER, &tun2); 953 err = drv(file, VIDIOC_G_TUNER, &tun2);
952 if (err < 0) 954 if (err < 0)
953 dprintk("VIDIOCSAUDIO / VIDIOC_G_TUNER: %d\n", err); 955 dprintk("VIDIOCSAUDIO / VIDIOC_G_TUNER: %ld\n", err);
954 if (err == 0) { 956 if (err == 0) {
955 switch (aud->mode) { 957 switch (aud->mode) {
956 default: 958 default:
@@ -967,19 +969,19 @@ static noinline int v4l1_compat_set_audio(
967 } 969 }
968 err = drv(file, VIDIOC_S_TUNER, &tun2); 970 err = drv(file, VIDIOC_S_TUNER, &tun2);
969 if (err < 0) 971 if (err < 0)
970 dprintk("VIDIOCSAUDIO / VIDIOC_S_TUNER: %d\n", err); 972 dprintk("VIDIOCSAUDIO / VIDIOC_S_TUNER: %ld\n", err);
971 } 973 }
972 err = 0; 974 err = 0;
973done: 975done:
974 return err; 976 return err;
975} 977}
976 978
977static noinline int v4l1_compat_capture_frame( 979static noinline long v4l1_compat_capture_frame(
978 struct video_mmap *mm, 980 struct video_mmap *mm,
979 struct file *file, 981 struct file *file,
980 v4l2_kioctl drv) 982 v4l2_kioctl drv)
981{ 983{
982 int err; 984 long err;
983 enum v4l2_buf_type captype = V4L2_BUF_TYPE_VIDEO_CAPTURE; 985 enum v4l2_buf_type captype = V4L2_BUF_TYPE_VIDEO_CAPTURE;
984 struct v4l2_buffer buf; 986 struct v4l2_buffer buf;
985 struct v4l2_format *fmt; 987 struct v4l2_format *fmt;
@@ -994,7 +996,7 @@ static noinline int v4l1_compat_capture_frame(
994 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 996 fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
995 err = drv(file, VIDIOC_G_FMT, fmt); 997 err = drv(file, VIDIOC_G_FMT, fmt);
996 if (err < 0) { 998 if (err < 0) {
997 dprintk("VIDIOCMCAPTURE / VIDIOC_G_FMT: %d\n", err); 999 dprintk("VIDIOCMCAPTURE / VIDIOC_G_FMT: %ld\n", err);
998 goto done; 1000 goto done;
999 } 1001 }
1000 if (mm->width != fmt->fmt.pix.width || 1002 if (mm->width != fmt->fmt.pix.width ||
@@ -1010,7 +1012,7 @@ static noinline int v4l1_compat_capture_frame(
1010 fmt->fmt.pix.bytesperline = 0; 1012 fmt->fmt.pix.bytesperline = 0;
1011 err = drv(file, VIDIOC_S_FMT, fmt); 1013 err = drv(file, VIDIOC_S_FMT, fmt);
1012 if (err < 0) { 1014 if (err < 0) {
1013 dprintk("VIDIOCMCAPTURE / VIDIOC_S_FMT: %d\n", err); 1015 dprintk("VIDIOCMCAPTURE / VIDIOC_S_FMT: %ld\n", err);
1014 goto done; 1016 goto done;
1015 } 1017 }
1016 } 1018 }
@@ -1018,28 +1020,28 @@ static noinline int v4l1_compat_capture_frame(
1018 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 1020 buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1019 err = drv(file, VIDIOC_QUERYBUF, &buf); 1021 err = drv(file, VIDIOC_QUERYBUF, &buf);
1020 if (err < 0) { 1022 if (err < 0) {
1021 dprintk("VIDIOCMCAPTURE / VIDIOC_QUERYBUF: %d\n", err); 1023 dprintk("VIDIOCMCAPTURE / VIDIOC_QUERYBUF: %ld\n", err);
1022 goto done; 1024 goto done;
1023 } 1025 }
1024 err = drv(file, VIDIOC_QBUF, &buf); 1026 err = drv(file, VIDIOC_QBUF, &buf);
1025 if (err < 0) { 1027 if (err < 0) {
1026 dprintk("VIDIOCMCAPTURE / VIDIOC_QBUF: %d\n", err); 1028 dprintk("VIDIOCMCAPTURE / VIDIOC_QBUF: %ld\n", err);
1027 goto done; 1029 goto done;
1028 } 1030 }
1029 err = drv(file, VIDIOC_STREAMON, &captype); 1031 err = drv(file, VIDIOC_STREAMON, &captype);
1030 if (err < 0) 1032 if (err < 0)
1031 dprintk("VIDIOCMCAPTURE / VIDIOC_STREAMON: %d\n", err); 1033 dprintk("VIDIOCMCAPTURE / VIDIOC_STREAMON: %ld\n", err);
1032done: 1034done:
1033 kfree(fmt); 1035 kfree(fmt);
1034 return err; 1036 return err;
1035} 1037}
1036 1038
1037static noinline int v4l1_compat_sync( 1039static noinline long v4l1_compat_sync(
1038 int *i, 1040 int *i,
1039 struct file *file, 1041 struct file *file,
1040 v4l2_kioctl drv) 1042 v4l2_kioctl drv)
1041{ 1043{
1042 int err; 1044 long err;
1043 enum v4l2_buf_type captype = V4L2_BUF_TYPE_VIDEO_CAPTURE; 1045 enum v4l2_buf_type captype = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1044 struct v4l2_buffer buf; 1046 struct v4l2_buffer buf;
1045 struct poll_wqueues *pwq; 1047 struct poll_wqueues *pwq;
@@ -1050,7 +1052,7 @@ static noinline int v4l1_compat_sync(
1050 err = drv(file, VIDIOC_QUERYBUF, &buf); 1052 err = drv(file, VIDIOC_QUERYBUF, &buf);
1051 if (err < 0) { 1053 if (err < 0) {
1052 /* No such buffer */ 1054 /* No such buffer */
1053 dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err); 1055 dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %ld\n", err);
1054 goto done; 1056 goto done;
1055 } 1057 }
1056 if (!(buf.flags & V4L2_BUF_FLAG_MAPPED)) { 1058 if (!(buf.flags & V4L2_BUF_FLAG_MAPPED)) {
@@ -1062,7 +1064,7 @@ static noinline int v4l1_compat_sync(
1062 /* make sure capture actually runs so we don't block forever */ 1064 /* make sure capture actually runs so we don't block forever */
1063 err = drv(file, VIDIOC_STREAMON, &captype); 1065 err = drv(file, VIDIOC_STREAMON, &captype);
1064 if (err < 0) { 1066 if (err < 0) {
1065 dprintk("VIDIOCSYNC / VIDIOC_STREAMON: %d\n", err); 1067 dprintk("VIDIOCSYNC / VIDIOC_STREAMON: %ld\n", err);
1066 goto done; 1068 goto done;
1067 } 1069 }
1068 1070
@@ -1076,7 +1078,7 @@ static noinline int v4l1_compat_sync(
1076 break; 1078 break;
1077 err = drv(file, VIDIOC_QUERYBUF, &buf); 1079 err = drv(file, VIDIOC_QUERYBUF, &buf);
1078 if (err < 0) 1080 if (err < 0)
1079 dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %d\n", err); 1081 dprintk("VIDIOCSYNC / VIDIOC_QUERYBUF: %ld\n", err);
1080 } 1082 }
1081 kfree(pwq); 1083 kfree(pwq);
1082 if (!(buf.flags & V4L2_BUF_FLAG_DONE)) /* not done */ 1084 if (!(buf.flags & V4L2_BUF_FLAG_DONE)) /* not done */
@@ -1084,18 +1086,18 @@ static noinline int v4l1_compat_sync(
1084 do { 1086 do {
1085 err = drv(file, VIDIOC_DQBUF, &buf); 1087 err = drv(file, VIDIOC_DQBUF, &buf);
1086 if (err < 0) 1088 if (err < 0)
1087 dprintk("VIDIOCSYNC / VIDIOC_DQBUF: %d\n", err); 1089 dprintk("VIDIOCSYNC / VIDIOC_DQBUF: %ld\n", err);
1088 } while (err == 0 && buf.index != *i); 1090 } while (err == 0 && buf.index != *i);
1089done: 1091done:
1090 return err; 1092 return err;
1091} 1093}
1092 1094
1093static noinline int v4l1_compat_get_vbi_format( 1095static noinline long v4l1_compat_get_vbi_format(
1094 struct vbi_format *fmt, 1096 struct vbi_format *fmt,
1095 struct file *file, 1097 struct file *file,
1096 v4l2_kioctl drv) 1098 v4l2_kioctl drv)
1097{ 1099{
1098 int err; 1100 long err;
1099 struct v4l2_format *fmt2; 1101 struct v4l2_format *fmt2;
1100 1102
1101 fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL); 1103 fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
@@ -1107,7 +1109,7 @@ static noinline int v4l1_compat_get_vbi_format(
1107 1109
1108 err = drv(file, VIDIOC_G_FMT, fmt2); 1110 err = drv(file, VIDIOC_G_FMT, fmt2);
1109 if (err < 0) { 1111 if (err < 0) {
1110 dprintk("VIDIOCGVBIFMT / VIDIOC_G_FMT: %d\n", err); 1112 dprintk("VIDIOCGVBIFMT / VIDIOC_G_FMT: %ld\n", err);
1111 goto done; 1113 goto done;
1112 } 1114 }
1113 if (fmt2->fmt.vbi.sample_format != V4L2_PIX_FMT_GREY) { 1115 if (fmt2->fmt.vbi.sample_format != V4L2_PIX_FMT_GREY) {
@@ -1128,12 +1130,12 @@ done:
1128 return err; 1130 return err;
1129} 1131}
1130 1132
1131static noinline int v4l1_compat_set_vbi_format( 1133static noinline long v4l1_compat_set_vbi_format(
1132 struct vbi_format *fmt, 1134 struct vbi_format *fmt,
1133 struct file *file, 1135 struct file *file,
1134 v4l2_kioctl drv) 1136 v4l2_kioctl drv)
1135{ 1137{
1136 int err; 1138 long err;
1137 struct v4l2_format *fmt2 = NULL; 1139 struct v4l2_format *fmt2 = NULL;
1138 1140
1139 if (VIDEO_PALETTE_RAW != fmt->sample_format) { 1141 if (VIDEO_PALETTE_RAW != fmt->sample_format) {
@@ -1157,7 +1159,7 @@ static noinline int v4l1_compat_set_vbi_format(
1157 fmt2->fmt.vbi.flags = fmt->flags; 1159 fmt2->fmt.vbi.flags = fmt->flags;
1158 err = drv(file, VIDIOC_TRY_FMT, fmt2); 1160 err = drv(file, VIDIOC_TRY_FMT, fmt2);
1159 if (err < 0) { 1161 if (err < 0) {
1160 dprintk("VIDIOCSVBIFMT / VIDIOC_TRY_FMT: %d\n", err); 1162 dprintk("VIDIOCSVBIFMT / VIDIOC_TRY_FMT: %ld\n", err);
1161 goto done; 1163 goto done;
1162 } 1164 }
1163 1165
@@ -1174,7 +1176,7 @@ static noinline int v4l1_compat_set_vbi_format(
1174 } 1176 }
1175 err = drv(file, VIDIOC_S_FMT, fmt2); 1177 err = drv(file, VIDIOC_S_FMT, fmt2);
1176 if (err < 0) 1178 if (err < 0)
1177 dprintk("VIDIOCSVBIFMT / VIDIOC_S_FMT: %d\n", err); 1179 dprintk("VIDIOCSVBIFMT / VIDIOC_S_FMT: %ld\n", err);
1178done: 1180done:
1179 kfree(fmt2); 1181 kfree(fmt2);
1180 return err; 1182 return err;
@@ -1183,13 +1185,13 @@ done:
1183/* 1185/*
1184 * This function is exported. 1186 * This function is exported.
1185 */ 1187 */
1186int 1188long
1187v4l_compat_translate_ioctl(struct file *file, 1189v4l_compat_translate_ioctl(struct file *file,
1188 int cmd, 1190 int cmd,
1189 void *arg, 1191 void *arg,
1190 v4l2_kioctl drv) 1192 v4l2_kioctl drv)
1191{ 1193{
1192 int err; 1194 long err;
1193 1195
1194 switch (cmd) { 1196 switch (cmd) {
1195 case VIDIOCGCAP: /* capability */ 1197 case VIDIOCGCAP: /* capability */