aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/w9966.c
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/w9966.c
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/w9966.c')
-rw-r--r--drivers/media/video/w9966.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/media/video/w9966.c b/drivers/media/video/w9966.c
index 56c570c267ea..91500f57442a 100644
--- a/drivers/media/video/w9966.c
+++ b/drivers/media/video/w9966.c
@@ -180,19 +180,19 @@ static int w9966_i2c_wbyte(struct w9966_dev* cam, int data);
180static int w9966_i2c_rbyte(struct w9966_dev* cam); 180static int w9966_i2c_rbyte(struct w9966_dev* cam);
181#endif 181#endif
182 182
183static int w9966_v4l_ioctl(struct inode *inode, struct file *file, 183static int w9966_v4l_ioctl(struct file *file,
184 unsigned int cmd, unsigned long arg); 184 unsigned int cmd, unsigned long arg);
185static ssize_t w9966_v4l_read(struct file *file, char __user *buf, 185static ssize_t w9966_v4l_read(struct file *file, char __user *buf,
186 size_t count, loff_t *ppos); 186 size_t count, loff_t *ppos);
187 187
188static int w9966_exclusive_open(struct inode *inode, struct file *file) 188static int w9966_exclusive_open(struct file *file)
189{ 189{
190 struct w9966_dev *cam = video_drvdata(file); 190 struct w9966_dev *cam = video_drvdata(file);
191 191
192 return test_and_set_bit(0, &cam->in_use) ? -EBUSY : 0; 192 return test_and_set_bit(0, &cam->in_use) ? -EBUSY : 0;
193} 193}
194 194
195static int w9966_exclusive_release(struct inode *inode, struct file *file) 195static int w9966_exclusive_release(struct file *file)
196{ 196{
197 struct w9966_dev *cam = video_drvdata(file); 197 struct w9966_dev *cam = video_drvdata(file);
198 198
@@ -200,16 +200,12 @@ static int w9966_exclusive_release(struct inode *inode, struct file *file)
200 return 0; 200 return 0;
201} 201}
202 202
203static const struct file_operations w9966_fops = { 203static const struct v4l2_file_operations w9966_fops = {
204 .owner = THIS_MODULE, 204 .owner = THIS_MODULE,
205 .open = w9966_exclusive_open, 205 .open = w9966_exclusive_open,
206 .release = w9966_exclusive_release, 206 .release = w9966_exclusive_release,
207 .ioctl = w9966_v4l_ioctl, 207 .ioctl = w9966_v4l_ioctl,
208#ifdef CONFIG_COMPAT
209 .compat_ioctl = v4l_compat_ioctl32,
210#endif
211 .read = w9966_v4l_read, 208 .read = w9966_v4l_read,
212 .llseek = no_llseek,
213}; 209};
214static struct video_device w9966_template = { 210static struct video_device w9966_template = {
215 .name = W9966_DRIVERNAME, 211 .name = W9966_DRIVERNAME,
@@ -877,7 +873,7 @@ static int w9966_v4l_do_ioctl(struct file *file, unsigned int cmd, void *arg)
877 return 0; 873 return 0;
878} 874}
879 875
880static int w9966_v4l_ioctl(struct inode *inode, struct file *file, 876static int w9966_v4l_ioctl(struct file *file,
881 unsigned int cmd, unsigned long arg) 877 unsigned int cmd, unsigned long arg)
882{ 878{
883 return video_usercopy(file, cmd, arg, w9966_v4l_do_ioctl); 879 return video_usercopy(file, cmd, arg, w9966_v4l_do_ioctl);