diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2011-03-11 18:01:54 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-22 15:38:10 -0400 |
commit | 2e4784d0d3a6167e905a49d0dafa40b022fa1a55 (patch) | |
tree | 0e9da2ff65b47b4724850fd6cbfb33b261351c7e /drivers | |
parent | 13099294973b14f07915d0342af2be8fa0af589b (diff) |
[media] vivi: convert to core priority handling
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/vivi.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c index bd104d0ad36c..42500bf03a9c 100644 --- a/drivers/media/video/vivi.c +++ b/drivers/media/video/vivi.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <media/v4l2-device.h> | 31 | #include <media/v4l2-device.h> |
32 | #include <media/v4l2-ioctl.h> | 32 | #include <media/v4l2-ioctl.h> |
33 | #include <media/v4l2-ctrls.h> | 33 | #include <media/v4l2-ctrls.h> |
34 | #include <media/v4l2-fh.h> | ||
34 | #include <media/v4l2-common.h> | 35 | #include <media/v4l2-common.h> |
35 | 36 | ||
36 | #define VIVI_MODULE_NAME "vivi" | 37 | #define VIVI_MODULE_NAME "vivi" |
@@ -199,7 +200,6 @@ struct vivi_dev { | |||
199 | enum v4l2_field field; | 200 | enum v4l2_field field; |
200 | unsigned int field_count; | 201 | unsigned int field_count; |
201 | 202 | ||
202 | unsigned int open_count; | ||
203 | u8 bars[9][3]; | 203 | u8 bars[9][3]; |
204 | u8 line[MAX_WIDTH * 4]; | 204 | u8 line[MAX_WIDTH * 4]; |
205 | }; | 205 | }; |
@@ -996,15 +996,6 @@ static int vivi_s_ctrl(struct v4l2_ctrl *ctrl) | |||
996 | File operations for the device | 996 | File operations for the device |
997 | ------------------------------------------------------------------*/ | 997 | ------------------------------------------------------------------*/ |
998 | 998 | ||
999 | static int vivi_open(struct file *file) | ||
1000 | { | ||
1001 | struct vivi_dev *dev = video_drvdata(file); | ||
1002 | |||
1003 | dprintk(dev, 1, "%s, %p\n", __func__, file); | ||
1004 | dev->open_count++; | ||
1005 | return 0; | ||
1006 | } | ||
1007 | |||
1008 | static ssize_t | 999 | static ssize_t |
1009 | vivi_read(struct file *file, char __user *data, size_t count, loff_t *ppos) | 1000 | vivi_read(struct file *file, char __user *data, size_t count, loff_t *ppos) |
1010 | { | 1001 | { |
@@ -1033,9 +1024,9 @@ static int vivi_close(struct file *file) | |||
1033 | dprintk(dev, 1, "close called (dev=%s), file %p\n", | 1024 | dprintk(dev, 1, "close called (dev=%s), file %p\n", |
1034 | video_device_node_name(vdev), file); | 1025 | video_device_node_name(vdev), file); |
1035 | 1026 | ||
1036 | if (--dev->open_count == 0) | 1027 | if (v4l2_fh_is_singular_file(file)) |
1037 | vb2_queue_release(&dev->vb_vidq); | 1028 | vb2_queue_release(&dev->vb_vidq); |
1038 | return 0; | 1029 | return v4l2_fh_release(file); |
1039 | } | 1030 | } |
1040 | 1031 | ||
1041 | static int vivi_mmap(struct file *file, struct vm_area_struct *vma) | 1032 | static int vivi_mmap(struct file *file, struct vm_area_struct *vma) |
@@ -1128,7 +1119,7 @@ static const struct v4l2_ctrl_config vivi_ctrl_string = { | |||
1128 | 1119 | ||
1129 | static const struct v4l2_file_operations vivi_fops = { | 1120 | static const struct v4l2_file_operations vivi_fops = { |
1130 | .owner = THIS_MODULE, | 1121 | .owner = THIS_MODULE, |
1131 | .open = vivi_open, | 1122 | .open = v4l2_fh_open, |
1132 | .release = vivi_close, | 1123 | .release = vivi_close, |
1133 | .read = vivi_read, | 1124 | .read = vivi_read, |
1134 | .poll = vivi_poll, | 1125 | .poll = vivi_poll, |