diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2013-09-30 09:34:50 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2013-10-28 13:25:59 -0400 |
commit | 2e9e4f1182a001f263a2908c5f0115eacb3bd104 (patch) | |
tree | 281bd27ca58d557b875be9de199f51636fa56e28 /drivers/media | |
parent | 5166028d480c82f9a4d443db7c1a707f8aea285a (diff) |
[media] coda: prefix v4l2_ioctl_ops with coda_ instead of vidioc_
Moving the ioctl handler callbacks into the coda namespace helps
tremendously to make sense of backtraces.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
[k.debski@samsung.com: fix whitespace error near coda_subscribe_event]
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/coda.c | 123 |
1 files changed, 63 insertions, 60 deletions
diff --git a/drivers/media/platform/coda.c b/drivers/media/platform/coda.c index 82049f858d5c..6ddcf8ba5f76 100644 --- a/drivers/media/platform/coda.c +++ b/drivers/media/platform/coda.c | |||
@@ -412,8 +412,8 @@ static char *coda_product_name(int product) | |||
412 | /* | 412 | /* |
413 | * V4L2 ioctl() operations. | 413 | * V4L2 ioctl() operations. |
414 | */ | 414 | */ |
415 | static int vidioc_querycap(struct file *file, void *priv, | 415 | static int coda_querycap(struct file *file, void *priv, |
416 | struct v4l2_capability *cap) | 416 | struct v4l2_capability *cap) |
417 | { | 417 | { |
418 | struct coda_ctx *ctx = fh_to_ctx(priv); | 418 | struct coda_ctx *ctx = fh_to_ctx(priv); |
419 | 419 | ||
@@ -484,8 +484,8 @@ static int enum_fmt(void *priv, struct v4l2_fmtdesc *f, | |||
484 | return -EINVAL; | 484 | return -EINVAL; |
485 | } | 485 | } |
486 | 486 | ||
487 | static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, | 487 | static int coda_enum_fmt_vid_cap(struct file *file, void *priv, |
488 | struct v4l2_fmtdesc *f) | 488 | struct v4l2_fmtdesc *f) |
489 | { | 489 | { |
490 | struct coda_ctx *ctx = fh_to_ctx(priv); | 490 | struct coda_ctx *ctx = fh_to_ctx(priv); |
491 | struct vb2_queue *src_vq; | 491 | struct vb2_queue *src_vq; |
@@ -503,13 +503,14 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, | |||
503 | return enum_fmt(priv, f, V4L2_BUF_TYPE_VIDEO_CAPTURE, 0); | 503 | return enum_fmt(priv, f, V4L2_BUF_TYPE_VIDEO_CAPTURE, 0); |
504 | } | 504 | } |
505 | 505 | ||
506 | static int vidioc_enum_fmt_vid_out(struct file *file, void *priv, | 506 | static int coda_enum_fmt_vid_out(struct file *file, void *priv, |
507 | struct v4l2_fmtdesc *f) | 507 | struct v4l2_fmtdesc *f) |
508 | { | 508 | { |
509 | return enum_fmt(priv, f, V4L2_BUF_TYPE_VIDEO_OUTPUT, 0); | 509 | return enum_fmt(priv, f, V4L2_BUF_TYPE_VIDEO_OUTPUT, 0); |
510 | } | 510 | } |
511 | 511 | ||
512 | static int vidioc_g_fmt(struct file *file, void *priv, struct v4l2_format *f) | 512 | static int coda_g_fmt(struct file *file, void *priv, |
513 | struct v4l2_format *f) | ||
513 | { | 514 | { |
514 | struct vb2_queue *vq; | 515 | struct vb2_queue *vq; |
515 | struct coda_q_data *q_data; | 516 | struct coda_q_data *q_data; |
@@ -536,7 +537,7 @@ static int vidioc_g_fmt(struct file *file, void *priv, struct v4l2_format *f) | |||
536 | return 0; | 537 | return 0; |
537 | } | 538 | } |
538 | 539 | ||
539 | static int vidioc_try_fmt(struct coda_codec *codec, struct v4l2_format *f) | 540 | static int coda_try_fmt(struct coda_codec *codec, struct v4l2_format *f) |
540 | { | 541 | { |
541 | unsigned int max_w, max_h; | 542 | unsigned int max_w, max_h; |
542 | enum v4l2_field field; | 543 | enum v4l2_field field; |
@@ -575,8 +576,8 @@ static int vidioc_try_fmt(struct coda_codec *codec, struct v4l2_format *f) | |||
575 | return 0; | 576 | return 0; |
576 | } | 577 | } |
577 | 578 | ||
578 | static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, | 579 | static int coda_try_fmt_vid_cap(struct file *file, void *priv, |
579 | struct v4l2_format *f) | 580 | struct v4l2_format *f) |
580 | { | 581 | { |
581 | struct coda_ctx *ctx = fh_to_ctx(priv); | 582 | struct coda_ctx *ctx = fh_to_ctx(priv); |
582 | struct coda_codec *codec; | 583 | struct coda_codec *codec; |
@@ -604,7 +605,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, | |||
604 | 605 | ||
605 | f->fmt.pix.colorspace = ctx->colorspace; | 606 | f->fmt.pix.colorspace = ctx->colorspace; |
606 | 607 | ||
607 | ret = vidioc_try_fmt(codec, f); | 608 | ret = coda_try_fmt(codec, f); |
608 | if (ret < 0) | 609 | if (ret < 0) |
609 | return ret; | 610 | return ret; |
610 | 611 | ||
@@ -620,8 +621,8 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, | |||
620 | return 0; | 621 | return 0; |
621 | } | 622 | } |
622 | 623 | ||
623 | static int vidioc_try_fmt_vid_out(struct file *file, void *priv, | 624 | static int coda_try_fmt_vid_out(struct file *file, void *priv, |
624 | struct v4l2_format *f) | 625 | struct v4l2_format *f) |
625 | { | 626 | { |
626 | struct coda_ctx *ctx = fh_to_ctx(priv); | 627 | struct coda_ctx *ctx = fh_to_ctx(priv); |
627 | struct coda_codec *codec; | 628 | struct coda_codec *codec; |
@@ -633,10 +634,10 @@ static int vidioc_try_fmt_vid_out(struct file *file, void *priv, | |||
633 | if (!f->fmt.pix.colorspace) | 634 | if (!f->fmt.pix.colorspace) |
634 | f->fmt.pix.colorspace = V4L2_COLORSPACE_REC709; | 635 | f->fmt.pix.colorspace = V4L2_COLORSPACE_REC709; |
635 | 636 | ||
636 | return vidioc_try_fmt(codec, f); | 637 | return coda_try_fmt(codec, f); |
637 | } | 638 | } |
638 | 639 | ||
639 | static int vidioc_s_fmt(struct coda_ctx *ctx, struct v4l2_format *f) | 640 | static int coda_s_fmt(struct coda_ctx *ctx, struct v4l2_format *f) |
640 | { | 641 | { |
641 | struct coda_q_data *q_data; | 642 | struct coda_q_data *q_data; |
642 | struct vb2_queue *vq; | 643 | struct vb2_queue *vq; |
@@ -666,61 +667,62 @@ static int vidioc_s_fmt(struct coda_ctx *ctx, struct v4l2_format *f) | |||
666 | return 0; | 667 | return 0; |
667 | } | 668 | } |
668 | 669 | ||
669 | static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, | 670 | static int coda_s_fmt_vid_cap(struct file *file, void *priv, |
670 | struct v4l2_format *f) | 671 | struct v4l2_format *f) |
671 | { | 672 | { |
672 | struct coda_ctx *ctx = fh_to_ctx(priv); | 673 | struct coda_ctx *ctx = fh_to_ctx(priv); |
673 | int ret; | 674 | int ret; |
674 | 675 | ||
675 | ret = vidioc_try_fmt_vid_cap(file, priv, f); | 676 | ret = coda_try_fmt_vid_cap(file, priv, f); |
676 | if (ret) | 677 | if (ret) |
677 | return ret; | 678 | return ret; |
678 | 679 | ||
679 | return vidioc_s_fmt(ctx, f); | 680 | return coda_s_fmt(ctx, f); |
680 | } | 681 | } |
681 | 682 | ||
682 | static int vidioc_s_fmt_vid_out(struct file *file, void *priv, | 683 | static int coda_s_fmt_vid_out(struct file *file, void *priv, |
683 | struct v4l2_format *f) | 684 | struct v4l2_format *f) |
684 | { | 685 | { |
685 | struct coda_ctx *ctx = fh_to_ctx(priv); | 686 | struct coda_ctx *ctx = fh_to_ctx(priv); |
686 | int ret; | 687 | int ret; |
687 | 688 | ||
688 | ret = vidioc_try_fmt_vid_out(file, priv, f); | 689 | ret = coda_try_fmt_vid_out(file, priv, f); |
689 | if (ret) | 690 | if (ret) |
690 | return ret; | 691 | return ret; |
691 | 692 | ||
692 | ret = vidioc_s_fmt(ctx, f); | 693 | ret = coda_s_fmt(ctx, f); |
693 | if (ret) | 694 | if (ret) |
694 | ctx->colorspace = f->fmt.pix.colorspace; | 695 | ctx->colorspace = f->fmt.pix.colorspace; |
695 | 696 | ||
696 | return ret; | 697 | return ret; |
697 | } | 698 | } |
698 | 699 | ||
699 | static int vidioc_reqbufs(struct file *file, void *priv, | 700 | static int coda_reqbufs(struct file *file, void *priv, |
700 | struct v4l2_requestbuffers *reqbufs) | 701 | struct v4l2_requestbuffers *reqbufs) |
701 | { | 702 | { |
702 | struct coda_ctx *ctx = fh_to_ctx(priv); | 703 | struct coda_ctx *ctx = fh_to_ctx(priv); |
703 | 704 | ||
704 | return v4l2_m2m_reqbufs(file, ctx->m2m_ctx, reqbufs); | 705 | return v4l2_m2m_reqbufs(file, ctx->m2m_ctx, reqbufs); |
705 | } | 706 | } |
706 | 707 | ||
707 | static int vidioc_querybuf(struct file *file, void *priv, | 708 | static int coda_querybuf(struct file *file, void *priv, |
708 | struct v4l2_buffer *buf) | 709 | struct v4l2_buffer *buf) |
709 | { | 710 | { |
710 | struct coda_ctx *ctx = fh_to_ctx(priv); | 711 | struct coda_ctx *ctx = fh_to_ctx(priv); |
711 | 712 | ||
712 | return v4l2_m2m_querybuf(file, ctx->m2m_ctx, buf); | 713 | return v4l2_m2m_querybuf(file, ctx->m2m_ctx, buf); |
713 | } | 714 | } |
714 | 715 | ||
715 | static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *buf) | 716 | static int coda_qbuf(struct file *file, void *priv, |
717 | struct v4l2_buffer *buf) | ||
716 | { | 718 | { |
717 | struct coda_ctx *ctx = fh_to_ctx(priv); | 719 | struct coda_ctx *ctx = fh_to_ctx(priv); |
718 | 720 | ||
719 | return v4l2_m2m_qbuf(file, ctx->m2m_ctx, buf); | 721 | return v4l2_m2m_qbuf(file, ctx->m2m_ctx, buf); |
720 | } | 722 | } |
721 | 723 | ||
722 | static int vidioc_expbuf(struct file *file, void *priv, | 724 | static int coda_expbuf(struct file *file, void *priv, |
723 | struct v4l2_exportbuffer *eb) | 725 | struct v4l2_exportbuffer *eb) |
724 | { | 726 | { |
725 | struct coda_ctx *ctx = fh_to_ctx(priv); | 727 | struct coda_ctx *ctx = fh_to_ctx(priv); |
726 | 728 | ||
@@ -738,7 +740,8 @@ static bool coda_buf_is_end_of_stream(struct coda_ctx *ctx, | |||
738 | (buf->sequence == (ctx->qsequence - 1))); | 740 | (buf->sequence == (ctx->qsequence - 1))); |
739 | } | 741 | } |
740 | 742 | ||
741 | static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *buf) | 743 | static int coda_dqbuf(struct file *file, void *priv, |
744 | struct v4l2_buffer *buf) | ||
742 | { | 745 | { |
743 | struct coda_ctx *ctx = fh_to_ctx(priv); | 746 | struct coda_ctx *ctx = fh_to_ctx(priv); |
744 | int ret; | 747 | int ret; |
@@ -758,24 +761,24 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *buf) | |||
758 | return ret; | 761 | return ret; |
759 | } | 762 | } |
760 | 763 | ||
761 | static int vidioc_create_bufs(struct file *file, void *priv, | 764 | static int coda_create_bufs(struct file *file, void *priv, |
762 | struct v4l2_create_buffers *create) | 765 | struct v4l2_create_buffers *create) |
763 | { | 766 | { |
764 | struct coda_ctx *ctx = fh_to_ctx(priv); | 767 | struct coda_ctx *ctx = fh_to_ctx(priv); |
765 | 768 | ||
766 | return v4l2_m2m_create_bufs(file, ctx->m2m_ctx, create); | 769 | return v4l2_m2m_create_bufs(file, ctx->m2m_ctx, create); |
767 | } | 770 | } |
768 | 771 | ||
769 | static int vidioc_streamon(struct file *file, void *priv, | 772 | static int coda_streamon(struct file *file, void *priv, |
770 | enum v4l2_buf_type type) | 773 | enum v4l2_buf_type type) |
771 | { | 774 | { |
772 | struct coda_ctx *ctx = fh_to_ctx(priv); | 775 | struct coda_ctx *ctx = fh_to_ctx(priv); |
773 | 776 | ||
774 | return v4l2_m2m_streamon(file, ctx->m2m_ctx, type); | 777 | return v4l2_m2m_streamon(file, ctx->m2m_ctx, type); |
775 | } | 778 | } |
776 | 779 | ||
777 | static int vidioc_streamoff(struct file *file, void *priv, | 780 | static int coda_streamoff(struct file *file, void *priv, |
778 | enum v4l2_buf_type type) | 781 | enum v4l2_buf_type type) |
779 | { | 782 | { |
780 | struct coda_ctx *ctx = fh_to_ctx(priv); | 783 | struct coda_ctx *ctx = fh_to_ctx(priv); |
781 | int ret; | 784 | int ret; |
@@ -792,8 +795,8 @@ static int vidioc_streamoff(struct file *file, void *priv, | |||
792 | return ret; | 795 | return ret; |
793 | } | 796 | } |
794 | 797 | ||
795 | static int vidioc_decoder_cmd(struct file *file, void *fh, | 798 | static int coda_decoder_cmd(struct file *file, void *fh, |
796 | struct v4l2_decoder_cmd *dc) | 799 | struct v4l2_decoder_cmd *dc) |
797 | { | 800 | { |
798 | struct coda_ctx *ctx = fh_to_ctx(fh); | 801 | struct coda_ctx *ctx = fh_to_ctx(fh); |
799 | 802 | ||
@@ -816,8 +819,8 @@ static int vidioc_decoder_cmd(struct file *file, void *fh, | |||
816 | return 0; | 819 | return 0; |
817 | } | 820 | } |
818 | 821 | ||
819 | static int vidioc_subscribe_event(struct v4l2_fh *fh, | 822 | static int coda_subscribe_event(struct v4l2_fh *fh, |
820 | const struct v4l2_event_subscription *sub) | 823 | const struct v4l2_event_subscription *sub) |
821 | { | 824 | { |
822 | switch (sub->type) { | 825 | switch (sub->type) { |
823 | case V4L2_EVENT_EOS: | 826 | case V4L2_EVENT_EOS: |
@@ -828,32 +831,32 @@ static int vidioc_subscribe_event(struct v4l2_fh *fh, | |||
828 | } | 831 | } |
829 | 832 | ||
830 | static const struct v4l2_ioctl_ops coda_ioctl_ops = { | 833 | static const struct v4l2_ioctl_ops coda_ioctl_ops = { |
831 | .vidioc_querycap = vidioc_querycap, | 834 | .vidioc_querycap = coda_querycap, |
832 | 835 | ||
833 | .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, | 836 | .vidioc_enum_fmt_vid_cap = coda_enum_fmt_vid_cap, |
834 | .vidioc_g_fmt_vid_cap = vidioc_g_fmt, | 837 | .vidioc_g_fmt_vid_cap = coda_g_fmt, |
835 | .vidioc_try_fmt_vid_cap = vidioc_try_fmt_vid_cap, | 838 | .vidioc_try_fmt_vid_cap = coda_try_fmt_vid_cap, |
836 | .vidioc_s_fmt_vid_cap = vidioc_s_fmt_vid_cap, | 839 | .vidioc_s_fmt_vid_cap = coda_s_fmt_vid_cap, |
837 | 840 | ||
838 | .vidioc_enum_fmt_vid_out = vidioc_enum_fmt_vid_out, | 841 | .vidioc_enum_fmt_vid_out = coda_enum_fmt_vid_out, |
839 | .vidioc_g_fmt_vid_out = vidioc_g_fmt, | 842 | .vidioc_g_fmt_vid_out = coda_g_fmt, |
840 | .vidioc_try_fmt_vid_out = vidioc_try_fmt_vid_out, | 843 | .vidioc_try_fmt_vid_out = coda_try_fmt_vid_out, |
841 | .vidioc_s_fmt_vid_out = vidioc_s_fmt_vid_out, | 844 | .vidioc_s_fmt_vid_out = coda_s_fmt_vid_out, |
842 | 845 | ||
843 | .vidioc_reqbufs = vidioc_reqbufs, | 846 | .vidioc_reqbufs = coda_reqbufs, |
844 | .vidioc_querybuf = vidioc_querybuf, | 847 | .vidioc_querybuf = coda_querybuf, |
845 | 848 | ||
846 | .vidioc_qbuf = vidioc_qbuf, | 849 | .vidioc_qbuf = coda_qbuf, |
847 | .vidioc_expbuf = vidioc_expbuf, | 850 | .vidioc_expbuf = coda_expbuf, |
848 | .vidioc_dqbuf = vidioc_dqbuf, | 851 | .vidioc_dqbuf = coda_dqbuf, |
849 | .vidioc_create_bufs = vidioc_create_bufs, | 852 | .vidioc_create_bufs = coda_create_bufs, |
850 | 853 | ||
851 | .vidioc_streamon = vidioc_streamon, | 854 | .vidioc_streamon = coda_streamon, |
852 | .vidioc_streamoff = vidioc_streamoff, | 855 | .vidioc_streamoff = coda_streamoff, |
853 | 856 | ||
854 | .vidioc_decoder_cmd = vidioc_decoder_cmd, | 857 | .vidioc_decoder_cmd = coda_decoder_cmd, |
855 | 858 | ||
856 | .vidioc_subscribe_event = vidioc_subscribe_event, | 859 | .vidioc_subscribe_event = coda_subscribe_event, |
857 | .vidioc_unsubscribe_event = v4l2_event_unsubscribe, | 860 | .vidioc_unsubscribe_event = v4l2_event_unsubscribe, |
858 | }; | 861 | }; |
859 | 862 | ||