diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-12-30 04:58:20 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-01-02 14:11:12 -0500 |
commit | bec43661b1dc0075b7445223ba775674133b164d (patch) | |
tree | 2a09ad5cc78799985e5cfb789f0a23db58e70499 /drivers/media/video/ivtv | |
parent | dfa9a5ae679ff2d23caa995d0f55a19abaf0596e (diff) |
V4L/DVB (10135): v4l2: introduce v4l2_file_operations.
Introduce a struct v4l2_file_operations for v4l2 drivers.
Remove the unnecessary inode argument.
Move compat32 handling (and llseek) into the v4l2-dev core: this is now
handled in the v4l2 core and no longer in the drivers themselves.
Note that this changeset reverts an earlier patch that changed the return
type of__video_ioctl2 from int to long. This change will be reinstated
later in a much improved version.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/ivtv')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-fileops.c | 4 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-fileops.h | 4 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-ioctl.c | 2 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-streams.c | 8 |
4 files changed, 8 insertions, 10 deletions
diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c index 5eb587592e9d..d594bc29f07f 100644 --- a/drivers/media/video/ivtv/ivtv-fileops.c +++ b/drivers/media/video/ivtv/ivtv-fileops.c | |||
@@ -831,7 +831,7 @@ static void ivtv_stop_decoding(struct ivtv_open_id *id, int flags, u64 pts) | |||
831 | ivtv_release_stream(s); | 831 | ivtv_release_stream(s); |
832 | } | 832 | } |
833 | 833 | ||
834 | int ivtv_v4l2_close(struct inode *inode, struct file *filp) | 834 | int ivtv_v4l2_close(struct file *filp) |
835 | { | 835 | { |
836 | struct ivtv_open_id *id = filp->private_data; | 836 | struct ivtv_open_id *id = filp->private_data; |
837 | struct ivtv *itv = id->itv; | 837 | struct ivtv *itv = id->itv; |
@@ -978,7 +978,7 @@ static int ivtv_serialized_open(struct ivtv_stream *s, struct file *filp) | |||
978 | return 0; | 978 | return 0; |
979 | } | 979 | } |
980 | 980 | ||
981 | int ivtv_v4l2_open(struct inode *inode, struct file *filp) | 981 | int ivtv_v4l2_open(struct file *filp) |
982 | { | 982 | { |
983 | int res; | 983 | int res; |
984 | struct ivtv *itv = NULL; | 984 | struct ivtv *itv = NULL; |
diff --git a/drivers/media/video/ivtv/ivtv-fileops.h b/drivers/media/video/ivtv/ivtv-fileops.h index df81e790147f..049a2923965d 100644 --- a/drivers/media/video/ivtv/ivtv-fileops.h +++ b/drivers/media/video/ivtv/ivtv-fileops.h | |||
@@ -22,12 +22,12 @@ | |||
22 | #define IVTV_FILEOPS_H | 22 | #define IVTV_FILEOPS_H |
23 | 23 | ||
24 | /* Testing/Debugging */ | 24 | /* Testing/Debugging */ |
25 | int ivtv_v4l2_open(struct inode *inode, struct file *filp); | 25 | int ivtv_v4l2_open(struct file *filp); |
26 | ssize_t ivtv_v4l2_read(struct file *filp, char __user *buf, size_t count, | 26 | ssize_t ivtv_v4l2_read(struct file *filp, char __user *buf, size_t count, |
27 | loff_t * pos); | 27 | loff_t * pos); |
28 | ssize_t ivtv_v4l2_write(struct file *filp, const char __user *buf, size_t count, | 28 | ssize_t ivtv_v4l2_write(struct file *filp, const char __user *buf, size_t count, |
29 | loff_t * pos); | 29 | loff_t * pos); |
30 | int ivtv_v4l2_close(struct inode *inode, struct file *filp); | 30 | int ivtv_v4l2_close(struct file *filp); |
31 | unsigned int ivtv_v4l2_enc_poll(struct file *filp, poll_table * wait); | 31 | unsigned int ivtv_v4l2_enc_poll(struct file *filp, poll_table * wait); |
32 | unsigned int ivtv_v4l2_dec_poll(struct file *filp, poll_table * wait); | 32 | unsigned int ivtv_v4l2_dec_poll(struct file *filp, poll_table * wait); |
33 | int ivtv_start_capture(struct ivtv_open_id *id); | 33 | int ivtv_start_capture(struct ivtv_open_id *id); |
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c index cd990a4b81a9..a6cd02460e75 100644 --- a/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/drivers/media/video/ivtv/ivtv-ioctl.c | |||
@@ -1827,7 +1827,7 @@ static long ivtv_serialized_ioctl(struct ivtv *itv, struct file *filp, | |||
1827 | 1827 | ||
1828 | if (ivtv_debug & IVTV_DBGFLG_IOCTL) | 1828 | if (ivtv_debug & IVTV_DBGFLG_IOCTL) |
1829 | vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG; | 1829 | vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG; |
1830 | ret = __video_ioctl2(filp, cmd, arg); | 1830 | ret = video_ioctl2(filp, cmd, arg); |
1831 | vfd->debug = 0; | 1831 | vfd->debug = 0; |
1832 | return ret; | 1832 | return ret; |
1833 | } | 1833 | } |
diff --git a/drivers/media/video/ivtv/ivtv-streams.c b/drivers/media/video/ivtv/ivtv-streams.c index f77d764707b2..854a950af78c 100644 --- a/drivers/media/video/ivtv/ivtv-streams.c +++ b/drivers/media/video/ivtv/ivtv-streams.c | |||
@@ -43,24 +43,22 @@ | |||
43 | #include "ivtv-cards.h" | 43 | #include "ivtv-cards.h" |
44 | #include "ivtv-streams.h" | 44 | #include "ivtv-streams.h" |
45 | 45 | ||
46 | static const struct file_operations ivtv_v4l2_enc_fops = { | 46 | static const struct v4l2_file_operations ivtv_v4l2_enc_fops = { |
47 | .owner = THIS_MODULE, | 47 | .owner = THIS_MODULE, |
48 | .read = ivtv_v4l2_read, | 48 | .read = ivtv_v4l2_read, |
49 | .write = ivtv_v4l2_write, | 49 | .write = ivtv_v4l2_write, |
50 | .open = ivtv_v4l2_open, | 50 | .open = ivtv_v4l2_open, |
51 | .unlocked_ioctl = ivtv_v4l2_ioctl, | 51 | .unlocked_ioctl = ivtv_v4l2_ioctl, |
52 | .compat_ioctl = v4l_compat_ioctl32, | ||
53 | .release = ivtv_v4l2_close, | 52 | .release = ivtv_v4l2_close, |
54 | .poll = ivtv_v4l2_enc_poll, | 53 | .poll = ivtv_v4l2_enc_poll, |
55 | }; | 54 | }; |
56 | 55 | ||
57 | static const struct file_operations ivtv_v4l2_dec_fops = { | 56 | static const struct v4l2_file_operations ivtv_v4l2_dec_fops = { |
58 | .owner = THIS_MODULE, | 57 | .owner = THIS_MODULE, |
59 | .read = ivtv_v4l2_read, | 58 | .read = ivtv_v4l2_read, |
60 | .write = ivtv_v4l2_write, | 59 | .write = ivtv_v4l2_write, |
61 | .open = ivtv_v4l2_open, | 60 | .open = ivtv_v4l2_open, |
62 | .unlocked_ioctl = ivtv_v4l2_ioctl, | 61 | .unlocked_ioctl = ivtv_v4l2_ioctl, |
63 | .compat_ioctl = v4l_compat_ioctl32, | ||
64 | .release = ivtv_v4l2_close, | 62 | .release = ivtv_v4l2_close, |
65 | .poll = ivtv_v4l2_dec_poll, | 63 | .poll = ivtv_v4l2_dec_poll, |
66 | }; | 64 | }; |
@@ -78,7 +76,7 @@ static struct { | |||
78 | int num_offset; | 76 | int num_offset; |
79 | int dma, pio; | 77 | int dma, pio; |
80 | enum v4l2_buf_type buf_type; | 78 | enum v4l2_buf_type buf_type; |
81 | const struct file_operations *fops; | 79 | const struct v4l2_file_operations *fops; |
82 | } ivtv_stream_info[] = { | 80 | } ivtv_stream_info[] = { |
83 | { /* IVTV_ENC_STREAM_TYPE_MPG */ | 81 | { /* IVTV_ENC_STREAM_TYPE_MPG */ |
84 | "encoder MPG", | 82 | "encoder MPG", |