aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bt8xx
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-12-30 04:58:20 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-01-02 14:11:12 -0500
commitbec43661b1dc0075b7445223ba775674133b164d (patch)
tree2a09ad5cc78799985e5cfb789f0a23db58e70499 /drivers/media/video/bt8xx
parentdfa9a5ae679ff2d23caa995d0f55a19abaf0596e (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/bt8xx')
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 9ec4cec2e52d..ebcb8e5e9c4d 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -3208,9 +3208,9 @@ err:
3208 return POLLERR; 3208 return POLLERR;
3209} 3209}
3210 3210
3211static int bttv_open(struct inode *inode, struct file *file) 3211static int bttv_open(struct file *file)
3212{ 3212{
3213 int minor = iminor(inode); 3213 int minor = video_devdata(file)->minor;
3214 struct bttv *btv = NULL; 3214 struct bttv *btv = NULL;
3215 struct bttv_fh *fh; 3215 struct bttv_fh *fh;
3216 enum v4l2_buf_type type = 0; 3216 enum v4l2_buf_type type = 0;
@@ -3291,7 +3291,7 @@ static int bttv_open(struct inode *inode, struct file *file)
3291 return 0; 3291 return 0;
3292} 3292}
3293 3293
3294static int bttv_release(struct inode *inode, struct file *file) 3294static int bttv_release(struct file *file)
3295{ 3295{
3296 struct bttv_fh *fh = file->private_data; 3296 struct bttv_fh *fh = file->private_data;
3297 struct bttv *btv = fh->btv; 3297 struct bttv *btv = fh->btv;
@@ -3346,14 +3346,12 @@ bttv_mmap(struct file *file, struct vm_area_struct *vma)
3346 return videobuf_mmap_mapper(bttv_queue(fh),vma); 3346 return videobuf_mmap_mapper(bttv_queue(fh),vma);
3347} 3347}
3348 3348
3349static const struct file_operations bttv_fops = 3349static const struct v4l2_file_operations bttv_fops =
3350{ 3350{
3351 .owner = THIS_MODULE, 3351 .owner = THIS_MODULE,
3352 .open = bttv_open, 3352 .open = bttv_open,
3353 .release = bttv_release, 3353 .release = bttv_release,
3354 .ioctl = video_ioctl2, 3354 .ioctl = video_ioctl2,
3355 .compat_ioctl = v4l_compat_ioctl32,
3356 .llseek = no_llseek,
3357 .read = bttv_read, 3355 .read = bttv_read,
3358 .mmap = bttv_mmap, 3356 .mmap = bttv_mmap,
3359 .poll = bttv_poll, 3357 .poll = bttv_poll,
@@ -3422,9 +3420,9 @@ static struct video_device bttv_video_template = {
3422/* ----------------------------------------------------------------------- */ 3420/* ----------------------------------------------------------------------- */
3423/* radio interface */ 3421/* radio interface */
3424 3422
3425static int radio_open(struct inode *inode, struct file *file) 3423static int radio_open(struct file *file)
3426{ 3424{
3427 int minor = iminor(inode); 3425 int minor = video_devdata(file)->minor;
3428 struct bttv *btv = NULL; 3426 struct bttv *btv = NULL;
3429 struct bttv_fh *fh; 3427 struct bttv_fh *fh;
3430 unsigned int i; 3428 unsigned int i;
@@ -3467,7 +3465,7 @@ static int radio_open(struct inode *inode, struct file *file)
3467 return 0; 3465 return 0;
3468} 3466}
3469 3467
3470static int radio_release(struct inode *inode, struct file *file) 3468static int radio_release(struct file *file)
3471{ 3469{
3472 struct bttv_fh *fh = file->private_data; 3470 struct bttv_fh *fh = file->private_data;
3473 struct bttv *btv = fh->btv; 3471 struct bttv *btv = fh->btv;
@@ -3633,15 +3631,13 @@ static unsigned int radio_poll(struct file *file, poll_table *wait)
3633 return cmd.result; 3631 return cmd.result;
3634} 3632}
3635 3633
3636static const struct file_operations radio_fops = 3634static const struct v4l2_file_operations radio_fops =
3637{ 3635{
3638 .owner = THIS_MODULE, 3636 .owner = THIS_MODULE,
3639 .open = radio_open, 3637 .open = radio_open,
3640 .read = radio_read, 3638 .read = radio_read,
3641 .release = radio_release, 3639 .release = radio_release,
3642 .compat_ioctl = v4l_compat_ioctl32,
3643 .ioctl = video_ioctl2, 3640 .ioctl = video_ioctl2,
3644 .llseek = no_llseek,
3645 .poll = radio_poll, 3641 .poll = radio_poll,
3646}; 3642};
3647 3643