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: hdpvr: 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
536a8cdb 9ba9d115

+15 -9
+15 -9
drivers/media/usb/hdpvr/hdpvr-video.c
··· 52 52 bool legacy_mode; 53 53 }; 54 54 55 + static inline struct hdpvr_fh *file_to_hdpvr_fh(struct file *file) 56 + { 57 + return container_of(file_to_v4l2_fh(file), struct hdpvr_fh, fh); 58 + } 59 + 55 60 static uint list_size(struct list_head *list) 56 61 { 57 62 struct list_head *tmp; ··· 594 589 v4l2_std_id std) 595 590 { 596 591 struct hdpvr_device *dev = video_drvdata(file); 597 - struct hdpvr_fh *fh = _fh; 592 + struct hdpvr_fh *fh = file_to_hdpvr_fh(file); 598 593 u8 std_type = 1; 599 594 600 595 if (!fh->legacy_mode && dev->options.video_input == HDPVR_COMPONENT) ··· 614 609 v4l2_std_id *std) 615 610 { 616 611 struct hdpvr_device *dev = video_drvdata(file); 617 - struct hdpvr_fh *fh = _fh; 612 + struct hdpvr_fh *fh = file_to_hdpvr_fh(file); 613 + 618 614 619 615 if (!fh->legacy_mode && dev->options.video_input == HDPVR_COMPONENT) 620 616 return -ENODATA; ··· 626 620 static int vidioc_querystd(struct file *file, void *_fh, v4l2_std_id *a) 627 621 { 628 622 struct hdpvr_device *dev = video_drvdata(file); 623 + struct hdpvr_fh *fh = file_to_hdpvr_fh(file); 629 624 struct hdpvr_video_info vid_info; 630 - struct hdpvr_fh *fh = _fh; 631 625 int ret; 632 626 633 627 *a = V4L2_STD_UNKNOWN; ··· 646 640 struct v4l2_dv_timings *timings) 647 641 { 648 642 struct hdpvr_device *dev = video_drvdata(file); 649 - struct hdpvr_fh *fh = _fh; 643 + struct hdpvr_fh *fh = file_to_hdpvr_fh(file); 650 644 int i; 651 645 652 646 fh->legacy_mode = false; ··· 669 663 struct v4l2_dv_timings *timings) 670 664 { 671 665 struct hdpvr_device *dev = video_drvdata(file); 672 - struct hdpvr_fh *fh = _fh; 666 + struct hdpvr_fh *fh = file_to_hdpvr_fh(file); 673 667 674 668 fh->legacy_mode = false; 675 669 if (dev->options.video_input) ··· 682 676 struct v4l2_dv_timings *timings) 683 677 { 684 678 struct hdpvr_device *dev = video_drvdata(file); 685 - struct hdpvr_fh *fh = _fh; 679 + struct hdpvr_fh *fh = file_to_hdpvr_fh(file); 686 680 struct hdpvr_video_info vid_info; 687 681 bool interlaced; 688 682 int ret = 0; ··· 724 718 struct v4l2_enum_dv_timings *timings) 725 719 { 726 720 struct hdpvr_device *dev = video_drvdata(file); 727 - struct hdpvr_fh *fh = _fh; 721 + struct hdpvr_fh *fh = file_to_hdpvr_fh(file); 728 722 729 723 fh->legacy_mode = false; 730 724 memset(timings->reserved, 0, sizeof(timings->reserved)); ··· 740 734 struct v4l2_dv_timings_cap *cap) 741 735 { 742 736 struct hdpvr_device *dev = video_drvdata(file); 743 - struct hdpvr_fh *fh = _fh; 737 + struct hdpvr_fh *fh = file_to_hdpvr_fh(file); 744 738 745 739 fh->legacy_mode = false; 746 740 if (dev->options.video_input) ··· 1000 994 struct v4l2_format *f) 1001 995 { 1002 996 struct hdpvr_device *dev = video_drvdata(file); 1003 - struct hdpvr_fh *fh = _fh; 997 + struct hdpvr_fh *fh = file_to_hdpvr_fh(file); 1004 998 int ret; 1005 999 1006 1000 /*