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: usb: uvc: Access v4l2_fh from file

The v4l2_fh associated with an open file handle is now guaranteed
to be available in file->private_data, initialised by v4l2_fh_add().

Access the v4l2_fh, and from there the driver-specific structure,
from the file * in all ioctl handlers.

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Jacopo Mondi and committed by
Hans Verkuil
ee7aa3df 536a8cdb

+18 -18
+18 -18
drivers/media/usb/uvc/uvc_v4l2.c
··· 391 391 static int uvc_ioctl_g_fmt(struct file *file, void *fh, 392 392 struct v4l2_format *fmt) 393 393 { 394 - struct uvc_fh *handle = fh; 394 + struct uvc_fh *handle = to_uvc_fh(file); 395 395 struct uvc_streaming *stream = handle->stream; 396 396 const struct uvc_format *format; 397 397 const struct uvc_frame *frame; ··· 427 427 static int uvc_ioctl_s_fmt(struct file *file, void *fh, 428 428 struct v4l2_format *fmt) 429 429 { 430 - struct uvc_fh *handle = fh; 430 + struct uvc_fh *handle = to_uvc_fh(file); 431 431 struct uvc_streaming *stream = handle->stream; 432 432 struct uvc_streaming_control probe; 433 433 const struct uvc_format *format; ··· 460 460 struct v4l2_streamparm *parm) 461 461 { 462 462 u32 numerator, denominator; 463 - struct uvc_fh *handle = fh; 463 + struct uvc_fh *handle = to_uvc_fh(file); 464 464 struct uvc_streaming *stream = handle->stream; 465 465 466 466 if (parm->type != stream->type) ··· 496 496 static int uvc_ioctl_s_parm(struct file *file, void *fh, 497 497 struct v4l2_streamparm *parm) 498 498 { 499 - struct uvc_fh *handle = fh; 499 + struct uvc_fh *handle = to_uvc_fh(file); 500 500 struct uvc_streaming *stream = handle->stream; 501 501 struct uvc_streaming_control probe; 502 502 struct v4l2_fract timeperframe; ··· 641 641 static int uvc_ioctl_enum_fmt(struct file *file, void *fh, 642 642 struct v4l2_fmtdesc *fmt) 643 643 { 644 - struct uvc_fh *handle = fh; 644 + struct uvc_fh *handle = to_uvc_fh(file); 645 645 struct uvc_streaming *stream = handle->stream; 646 646 enum v4l2_buf_type type = fmt->type; 647 647 const struct uvc_format *format; ··· 665 665 static int uvc_ioctl_try_fmt(struct file *file, void *fh, 666 666 struct v4l2_format *fmt) 667 667 { 668 - struct uvc_fh *handle = fh; 668 + struct uvc_fh *handle = to_uvc_fh(file); 669 669 struct uvc_streaming *stream = handle->stream; 670 670 struct uvc_streaming_control probe; 671 671 ··· 675 675 static int uvc_ioctl_enum_input(struct file *file, void *fh, 676 676 struct v4l2_input *input) 677 677 { 678 - struct uvc_fh *handle = fh; 678 + struct uvc_fh *handle = to_uvc_fh(file); 679 679 struct uvc_video_chain *chain = handle->chain; 680 680 const struct uvc_entity *selector = chain->selector; 681 681 struct uvc_entity *iterm = NULL; ··· 717 717 718 718 static int uvc_ioctl_g_input(struct file *file, void *fh, unsigned int *input) 719 719 { 720 - struct uvc_fh *handle = fh; 720 + struct uvc_fh *handle = to_uvc_fh(file); 721 721 struct uvc_video_chain *chain = handle->chain; 722 722 u8 *buf; 723 723 int ret; ··· 745 745 746 746 static int uvc_ioctl_s_input(struct file *file, void *fh, unsigned int input) 747 747 { 748 - struct uvc_fh *handle = fh; 748 + struct uvc_fh *handle = to_uvc_fh(file); 749 749 struct uvc_streaming *stream = handle->stream; 750 750 struct uvc_video_chain *chain = handle->chain; 751 751 u8 *buf; ··· 780 780 static int uvc_ioctl_query_ext_ctrl(struct file *file, void *fh, 781 781 struct v4l2_query_ext_ctrl *qec) 782 782 { 783 - struct uvc_fh *handle = fh; 783 + struct uvc_fh *handle = to_uvc_fh(file); 784 784 struct uvc_video_chain *chain = handle->chain; 785 785 786 786 return uvc_query_v4l2_ctrl(chain, qec); ··· 808 808 static int uvc_ioctl_g_ext_ctrls(struct file *file, void *fh, 809 809 struct v4l2_ext_controls *ctrls) 810 810 { 811 - struct uvc_fh *handle = fh; 811 + struct uvc_fh *handle = to_uvc_fh(file); 812 812 struct uvc_video_chain *chain = handle->chain; 813 813 struct v4l2_ext_control *ctrl = ctrls->controls; 814 814 unsigned int i; ··· 892 892 static int uvc_ioctl_s_ext_ctrls(struct file *file, void *fh, 893 893 struct v4l2_ext_controls *ctrls) 894 894 { 895 - struct uvc_fh *handle = fh; 895 + struct uvc_fh *handle = to_uvc_fh(file); 896 896 897 897 return uvc_ioctl_s_try_ext_ctrls(handle, ctrls, VIDIOC_S_EXT_CTRLS); 898 898 } ··· 900 900 static int uvc_ioctl_try_ext_ctrls(struct file *file, void *fh, 901 901 struct v4l2_ext_controls *ctrls) 902 902 { 903 - struct uvc_fh *handle = fh; 903 + struct uvc_fh *handle = to_uvc_fh(file); 904 904 905 905 return uvc_ioctl_s_try_ext_ctrls(handle, ctrls, VIDIOC_TRY_EXT_CTRLS); 906 906 } ··· 908 908 static int uvc_ioctl_querymenu(struct file *file, void *fh, 909 909 struct v4l2_querymenu *qm) 910 910 { 911 - struct uvc_fh *handle = fh; 911 + struct uvc_fh *handle = to_uvc_fh(file); 912 912 struct uvc_video_chain *chain = handle->chain; 913 913 914 914 return uvc_query_v4l2_menu(chain, qm); ··· 917 917 static int uvc_ioctl_g_selection(struct file *file, void *fh, 918 918 struct v4l2_selection *sel) 919 919 { 920 - struct uvc_fh *handle = fh; 920 + struct uvc_fh *handle = to_uvc_fh(file); 921 921 struct uvc_streaming *stream = handle->stream; 922 922 923 923 if (sel->type != stream->type) ··· 951 951 static int uvc_ioctl_enum_framesizes(struct file *file, void *fh, 952 952 struct v4l2_frmsizeenum *fsize) 953 953 { 954 - struct uvc_fh *handle = fh; 954 + struct uvc_fh *handle = to_uvc_fh(file); 955 955 struct uvc_streaming *stream = handle->stream; 956 956 const struct uvc_format *format = NULL; 957 957 const struct uvc_frame *frame = NULL; ··· 991 991 static int uvc_ioctl_enum_frameintervals(struct file *file, void *fh, 992 992 struct v4l2_frmivalenum *fival) 993 993 { 994 - struct uvc_fh *handle = fh; 994 + struct uvc_fh *handle = to_uvc_fh(file); 995 995 struct uvc_streaming *stream = handle->stream; 996 996 const struct uvc_format *format = NULL; 997 997 const struct uvc_frame *frame = NULL; ··· 1063 1063 static long uvc_ioctl_default(struct file *file, void *fh, bool valid_prio, 1064 1064 unsigned int cmd, void *arg) 1065 1065 { 1066 - struct uvc_fh *handle = fh; 1066 + struct uvc_fh *handle = to_uvc_fh(file); 1067 1067 struct uvc_video_chain *chain = handle->chain; 1068 1068 1069 1069 switch (cmd) {