Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

media: uvcvideo: Rename second ioctl handlers argument to 'void *priv'

The second argument to the ioctl handlers is not a file handle any more.
Rename it from 'void *fh' to 'void *priv', to avoid misconceptions. This
is particularly important in the uvcvideo driver, as it is widely used
and can be taken as an example for new drivers.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Laurent Pinchart and committed by
Hans Verkuil
0960b693 bb74fac7

+25 -25
+6 -6
drivers/media/usb/uvc/uvc_metadata.c
··· 23 23 * V4L2 ioctls 24 24 */ 25 25 26 - static int uvc_meta_v4l2_querycap(struct file *file, void *fh, 26 + static int uvc_meta_v4l2_querycap(struct file *file, void *priv, 27 27 struct v4l2_capability *cap) 28 28 { 29 29 struct v4l2_fh *vfh = file_to_v4l2_fh(file); ··· 39 39 return 0; 40 40 } 41 41 42 - static int uvc_meta_v4l2_get_format(struct file *file, void *fh, 42 + static int uvc_meta_v4l2_get_format(struct file *file, void *priv, 43 43 struct v4l2_format *format) 44 44 { 45 45 struct v4l2_fh *vfh = file_to_v4l2_fh(file); ··· 57 57 return 0; 58 58 } 59 59 60 - static int uvc_meta_v4l2_try_format(struct file *file, void *fh, 60 + static int uvc_meta_v4l2_try_format(struct file *file, void *priv, 61 61 struct v4l2_format *format) 62 62 { 63 63 struct v4l2_fh *vfh = file_to_v4l2_fh(file); ··· 83 83 return 0; 84 84 } 85 85 86 - static int uvc_meta_v4l2_set_format(struct file *file, void *fh, 86 + static int uvc_meta_v4l2_set_format(struct file *file, void *priv, 87 87 struct v4l2_format *format) 88 88 { 89 89 struct v4l2_fh *vfh = file_to_v4l2_fh(file); ··· 91 91 struct v4l2_meta_format *fmt = &format->fmt.meta; 92 92 int ret; 93 93 94 - ret = uvc_meta_v4l2_try_format(file, fh, format); 94 + ret = uvc_meta_v4l2_try_format(file, priv, format); 95 95 if (ret < 0) 96 96 return ret; 97 97 ··· 112 112 return ret; 113 113 } 114 114 115 - static int uvc_meta_v4l2_enum_formats(struct file *file, void *fh, 115 + static int uvc_meta_v4l2_enum_formats(struct file *file, void *priv, 116 116 struct v4l2_fmtdesc *fdesc) 117 117 { 118 118 struct v4l2_fh *vfh = file_to_v4l2_fh(file);
+19 -19
drivers/media/usb/uvc/uvc_v4l2.c
··· 388 388 return ret; 389 389 } 390 390 391 - static int uvc_ioctl_g_fmt(struct file *file, void *fh, 391 + static int uvc_ioctl_g_fmt(struct file *file, void *priv, 392 392 struct v4l2_format *fmt) 393 393 { 394 394 struct uvc_fh *handle = to_uvc_fh(file); ··· 424 424 return ret; 425 425 } 426 426 427 - static int uvc_ioctl_s_fmt(struct file *file, void *fh, 427 + static int uvc_ioctl_s_fmt(struct file *file, void *priv, 428 428 struct v4l2_format *fmt) 429 429 { 430 430 struct uvc_fh *handle = to_uvc_fh(file); ··· 456 456 return ret; 457 457 } 458 458 459 - static int uvc_ioctl_g_parm(struct file *file, void *fh, 459 + static int uvc_ioctl_g_parm(struct file *file, void *priv, 460 460 struct v4l2_streamparm *parm) 461 461 { 462 462 u32 numerator, denominator; ··· 493 493 return 0; 494 494 } 495 495 496 - static int uvc_ioctl_s_parm(struct file *file, void *fh, 496 + static int uvc_ioctl_s_parm(struct file *file, void *priv, 497 497 struct v4l2_streamparm *parm) 498 498 { 499 499 struct uvc_fh *handle = to_uvc_fh(file); ··· 622 622 return 0; 623 623 } 624 624 625 - static int uvc_ioctl_querycap(struct file *file, void *fh, 625 + static int uvc_ioctl_querycap(struct file *file, void *priv, 626 626 struct v4l2_capability *cap) 627 627 { 628 628 struct uvc_fh *handle = to_uvc_fh(file); ··· 638 638 return 0; 639 639 } 640 640 641 - static int uvc_ioctl_enum_fmt(struct file *file, void *fh, 641 + static int uvc_ioctl_enum_fmt(struct file *file, void *priv, 642 642 struct v4l2_fmtdesc *fmt) 643 643 { 644 644 struct uvc_fh *handle = to_uvc_fh(file); ··· 662 662 return 0; 663 663 } 664 664 665 - static int uvc_ioctl_try_fmt(struct file *file, void *fh, 665 + static int uvc_ioctl_try_fmt(struct file *file, void *priv, 666 666 struct v4l2_format *fmt) 667 667 { 668 668 struct uvc_fh *handle = to_uvc_fh(file); ··· 672 672 return uvc_v4l2_try_format(stream, fmt, &probe, NULL, NULL); 673 673 } 674 674 675 - static int uvc_ioctl_enum_input(struct file *file, void *fh, 675 + static int uvc_ioctl_enum_input(struct file *file, void *priv, 676 676 struct v4l2_input *input) 677 677 { 678 678 struct uvc_fh *handle = to_uvc_fh(file); ··· 715 715 return 0; 716 716 } 717 717 718 - static int uvc_ioctl_g_input(struct file *file, void *fh, unsigned int *input) 718 + static int uvc_ioctl_g_input(struct file *file, void *priv, unsigned int *input) 719 719 { 720 720 struct uvc_fh *handle = to_uvc_fh(file); 721 721 struct uvc_video_chain *chain = handle->chain; ··· 743 743 return ret; 744 744 } 745 745 746 - static int uvc_ioctl_s_input(struct file *file, void *fh, unsigned int input) 746 + static int uvc_ioctl_s_input(struct file *file, void *priv, unsigned int input) 747 747 { 748 748 struct uvc_fh *handle = to_uvc_fh(file); 749 749 struct uvc_streaming *stream = handle->stream; ··· 777 777 return ret; 778 778 } 779 779 780 - static int uvc_ioctl_query_ext_ctrl(struct file *file, void *fh, 780 + static int uvc_ioctl_query_ext_ctrl(struct file *file, void *priv, 781 781 struct v4l2_query_ext_ctrl *qec) 782 782 { 783 783 struct uvc_fh *handle = to_uvc_fh(file); ··· 805 805 return ret; 806 806 } 807 807 808 - static int uvc_ioctl_g_ext_ctrls(struct file *file, void *fh, 808 + static int uvc_ioctl_g_ext_ctrls(struct file *file, void *priv, 809 809 struct v4l2_ext_controls *ctrls) 810 810 { 811 811 struct uvc_fh *handle = to_uvc_fh(file); ··· 889 889 return uvc_ctrl_rollback(handle); 890 890 } 891 891 892 - static int uvc_ioctl_s_ext_ctrls(struct file *file, void *fh, 892 + static int uvc_ioctl_s_ext_ctrls(struct file *file, void *priv, 893 893 struct v4l2_ext_controls *ctrls) 894 894 { 895 895 struct uvc_fh *handle = to_uvc_fh(file); ··· 897 897 return uvc_ioctl_s_try_ext_ctrls(handle, ctrls, VIDIOC_S_EXT_CTRLS); 898 898 } 899 899 900 - static int uvc_ioctl_try_ext_ctrls(struct file *file, void *fh, 900 + static int uvc_ioctl_try_ext_ctrls(struct file *file, void *priv, 901 901 struct v4l2_ext_controls *ctrls) 902 902 { 903 903 struct uvc_fh *handle = to_uvc_fh(file); ··· 905 905 return uvc_ioctl_s_try_ext_ctrls(handle, ctrls, VIDIOC_TRY_EXT_CTRLS); 906 906 } 907 907 908 - static int uvc_ioctl_querymenu(struct file *file, void *fh, 908 + static int uvc_ioctl_querymenu(struct file *file, void *priv, 909 909 struct v4l2_querymenu *qm) 910 910 { 911 911 struct uvc_fh *handle = to_uvc_fh(file); ··· 914 914 return uvc_query_v4l2_menu(chain, qm); 915 915 } 916 916 917 - static int uvc_ioctl_g_selection(struct file *file, void *fh, 917 + static int uvc_ioctl_g_selection(struct file *file, void *priv, 918 918 struct v4l2_selection *sel) 919 919 { 920 920 struct uvc_fh *handle = to_uvc_fh(file); ··· 948 948 return 0; 949 949 } 950 950 951 - static int uvc_ioctl_enum_framesizes(struct file *file, void *fh, 951 + static int uvc_ioctl_enum_framesizes(struct file *file, void *priv, 952 952 struct v4l2_frmsizeenum *fsize) 953 953 { 954 954 struct uvc_fh *handle = to_uvc_fh(file); ··· 988 988 return 0; 989 989 } 990 990 991 - static int uvc_ioctl_enum_frameintervals(struct file *file, void *fh, 991 + static int uvc_ioctl_enum_frameintervals(struct file *file, void *priv, 992 992 struct v4l2_frmivalenum *fival) 993 993 { 994 994 struct uvc_fh *handle = to_uvc_fh(file); ··· 1060 1060 } 1061 1061 } 1062 1062 1063 - static long uvc_ioctl_default(struct file *file, void *fh, bool valid_prio, 1063 + static long uvc_ioctl_default(struct file *file, void *priv, bool valid_prio, 1064 1064 unsigned int cmd, void *arg) 1065 1065 { 1066 1066 struct uvc_fh *handle = to_uvc_fh(file);