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/saa7134 | |
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/saa7134')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-empress.c | 9 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-video.c | 14 |
2 files changed, 9 insertions, 14 deletions
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c index 7f40511bcc04..3beba480137f 100644 --- a/drivers/media/video/saa7134/saa7134-empress.c +++ b/drivers/media/video/saa7134/saa7134-empress.c | |||
@@ -83,9 +83,9 @@ static int ts_init_encoder(struct saa7134_dev* dev) | |||
83 | 83 | ||
84 | /* ------------------------------------------------------------------ */ | 84 | /* ------------------------------------------------------------------ */ |
85 | 85 | ||
86 | static int ts_open(struct inode *inode, struct file *file) | 86 | static int ts_open(struct file *file) |
87 | { | 87 | { |
88 | int minor = iminor(inode); | 88 | int minor = video_devdata(file)->minor; |
89 | struct saa7134_dev *dev; | 89 | struct saa7134_dev *dev; |
90 | int err; | 90 | int err; |
91 | 91 | ||
@@ -119,7 +119,7 @@ done: | |||
119 | return err; | 119 | return err; |
120 | } | 120 | } |
121 | 121 | ||
122 | static int ts_release(struct inode *inode, struct file *file) | 122 | static int ts_release(struct file *file) |
123 | { | 123 | { |
124 | struct saa7134_dev *dev = file->private_data; | 124 | struct saa7134_dev *dev = file->private_data; |
125 | 125 | ||
@@ -437,7 +437,7 @@ static int empress_g_std(struct file *file, void *priv, v4l2_std_id *id) | |||
437 | return 0; | 437 | return 0; |
438 | } | 438 | } |
439 | 439 | ||
440 | static const struct file_operations ts_fops = | 440 | static const struct v4l2_file_operations ts_fops = |
441 | { | 441 | { |
442 | .owner = THIS_MODULE, | 442 | .owner = THIS_MODULE, |
443 | .open = ts_open, | 443 | .open = ts_open, |
@@ -446,7 +446,6 @@ static const struct file_operations ts_fops = | |||
446 | .poll = ts_poll, | 446 | .poll = ts_poll, |
447 | .mmap = ts_mmap, | 447 | .mmap = ts_mmap, |
448 | .ioctl = video_ioctl2, | 448 | .ioctl = video_ioctl2, |
449 | .llseek = no_llseek, | ||
450 | }; | 449 | }; |
451 | 450 | ||
452 | static const struct v4l2_ioctl_ops ts_ioctl_ops = { | 451 | static const struct v4l2_ioctl_ops ts_ioctl_ops = { |
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c index 02bb6747a39c..6b2ab57538ee 100644 --- a/drivers/media/video/saa7134/saa7134-video.c +++ b/drivers/media/video/saa7134/saa7134-video.c | |||
@@ -1326,9 +1326,9 @@ static int saa7134_resource(struct saa7134_fh *fh) | |||
1326 | return 0; | 1326 | return 0; |
1327 | } | 1327 | } |
1328 | 1328 | ||
1329 | static int video_open(struct inode *inode, struct file *file) | 1329 | static int video_open(struct file *file) |
1330 | { | 1330 | { |
1331 | int minor = iminor(inode); | 1331 | int minor = video_devdata(file)->minor; |
1332 | struct saa7134_dev *dev; | 1332 | struct saa7134_dev *dev; |
1333 | struct saa7134_fh *fh; | 1333 | struct saa7134_fh *fh; |
1334 | enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | 1334 | enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
@@ -1462,7 +1462,7 @@ err: | |||
1462 | return POLLERR; | 1462 | return POLLERR; |
1463 | } | 1463 | } |
1464 | 1464 | ||
1465 | static int video_release(struct inode *inode, struct file *file) | 1465 | static int video_release(struct file *file) |
1466 | { | 1466 | { |
1467 | struct saa7134_fh *fh = file->private_data; | 1467 | struct saa7134_fh *fh = file->private_data; |
1468 | struct saa7134_dev *dev = fh->dev; | 1468 | struct saa7134_dev *dev = fh->dev; |
@@ -2377,7 +2377,7 @@ static int radio_queryctrl(struct file *file, void *priv, | |||
2377 | return 0; | 2377 | return 0; |
2378 | } | 2378 | } |
2379 | 2379 | ||
2380 | static const struct file_operations video_fops = | 2380 | static const struct v4l2_file_operations video_fops = |
2381 | { | 2381 | { |
2382 | .owner = THIS_MODULE, | 2382 | .owner = THIS_MODULE, |
2383 | .open = video_open, | 2383 | .open = video_open, |
@@ -2386,8 +2386,6 @@ static const struct file_operations video_fops = | |||
2386 | .poll = video_poll, | 2386 | .poll = video_poll, |
2387 | .mmap = video_mmap, | 2387 | .mmap = video_mmap, |
2388 | .ioctl = video_ioctl2, | 2388 | .ioctl = video_ioctl2, |
2389 | .compat_ioctl = v4l_compat_ioctl32, | ||
2390 | .llseek = no_llseek, | ||
2391 | }; | 2389 | }; |
2392 | 2390 | ||
2393 | static const struct v4l2_ioctl_ops video_ioctl_ops = { | 2391 | static const struct v4l2_ioctl_ops video_ioctl_ops = { |
@@ -2441,13 +2439,11 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = { | |||
2441 | #endif | 2439 | #endif |
2442 | }; | 2440 | }; |
2443 | 2441 | ||
2444 | static const struct file_operations radio_fops = { | 2442 | static const struct v4l2_file_operations radio_fops = { |
2445 | .owner = THIS_MODULE, | 2443 | .owner = THIS_MODULE, |
2446 | .open = video_open, | 2444 | .open = video_open, |
2447 | .release = video_release, | 2445 | .release = video_release, |
2448 | .ioctl = video_ioctl2, | 2446 | .ioctl = video_ioctl2, |
2449 | .compat_ioctl = v4l_compat_ioctl32, | ||
2450 | .llseek = no_llseek, | ||
2451 | }; | 2447 | }; |
2452 | 2448 | ||
2453 | static const struct v4l2_ioctl_ops radio_ioctl_ops = { | 2449 | static const struct v4l2_ioctl_ops radio_ioctl_ops = { |