aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common/saa7146_fops.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/common/saa7146_fops.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/common/saa7146_fops.c')
-rw-r--r--drivers/media/common/saa7146_fops.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/media/common/saa7146_fops.c b/drivers/media/common/saa7146_fops.c
index 7d844af88384..fad7fd85e5b6 100644
--- a/drivers/media/common/saa7146_fops.c
+++ b/drivers/media/common/saa7146_fops.c
@@ -192,9 +192,9 @@ void saa7146_buffer_timeout(unsigned long data)
192/********************************************************************************/ 192/********************************************************************************/
193/* file operations */ 193/* file operations */
194 194
195static int fops_open(struct inode *inode, struct file *file) 195static int fops_open(struct file *file)
196{ 196{
197 unsigned int minor = iminor(inode); 197 unsigned int minor = video_devdata(file)->minor;
198 struct saa7146_dev *h = NULL, *dev = NULL; 198 struct saa7146_dev *h = NULL, *dev = NULL;
199 struct list_head *list; 199 struct list_head *list;
200 struct saa7146_fh *fh = NULL; 200 struct saa7146_fh *fh = NULL;
@@ -202,7 +202,7 @@ static int fops_open(struct inode *inode, struct file *file)
202 202
203 enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 203 enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
204 204
205 DEB_EE(("inode:%p, file:%p, minor:%d\n",inode,file,minor)); 205 DEB_EE(("file:%p, minor:%d\n", file, minor));
206 206
207 if (mutex_lock_interruptible(&saa7146_devices_lock)) 207 if (mutex_lock_interruptible(&saa7146_devices_lock))
208 return -ERESTARTSYS; 208 return -ERESTARTSYS;
@@ -255,7 +255,7 @@ static int fops_open(struct inode *inode, struct file *file)
255 if (dev->ext_vv_data->capabilities & V4L2_CAP_VBI_CAPTURE) 255 if (dev->ext_vv_data->capabilities & V4L2_CAP_VBI_CAPTURE)
256 result = saa7146_vbi_uops.open(dev,file); 256 result = saa7146_vbi_uops.open(dev,file);
257 if (dev->ext_vv_data->vbi_fops.open) 257 if (dev->ext_vv_data->vbi_fops.open)
258 dev->ext_vv_data->vbi_fops.open(inode, file); 258 dev->ext_vv_data->vbi_fops.open(file);
259 } else { 259 } else {
260 DEB_S(("initializing video...\n")); 260 DEB_S(("initializing video...\n"));
261 result = saa7146_video_uops.open(dev,file); 261 result = saa7146_video_uops.open(dev,file);
@@ -280,12 +280,12 @@ out:
280 return result; 280 return result;
281} 281}
282 282
283static int fops_release(struct inode *inode, struct file *file) 283static int fops_release(struct file *file)
284{ 284{
285 struct saa7146_fh *fh = file->private_data; 285 struct saa7146_fh *fh = file->private_data;
286 struct saa7146_dev *dev = fh->dev; 286 struct saa7146_dev *dev = fh->dev;
287 287
288 DEB_EE(("inode:%p, file:%p\n",inode,file)); 288 DEB_EE(("file:%p\n", file));
289 289
290 if (mutex_lock_interruptible(&saa7146_devices_lock)) 290 if (mutex_lock_interruptible(&saa7146_devices_lock))
291 return -ERESTARTSYS; 291 return -ERESTARTSYS;
@@ -294,7 +294,7 @@ static int fops_release(struct inode *inode, struct file *file)
294 if (dev->ext_vv_data->capabilities & V4L2_CAP_VBI_CAPTURE) 294 if (dev->ext_vv_data->capabilities & V4L2_CAP_VBI_CAPTURE)
295 saa7146_vbi_uops.release(dev,file); 295 saa7146_vbi_uops.release(dev,file);
296 if (dev->ext_vv_data->vbi_fops.release) 296 if (dev->ext_vv_data->vbi_fops.release)
297 dev->ext_vv_data->vbi_fops.release(inode, file); 297 dev->ext_vv_data->vbi_fops.release(file);
298 } else { 298 } else {
299 saa7146_video_uops.release(dev,file); 299 saa7146_video_uops.release(dev,file);
300 } 300 }
@@ -308,10 +308,10 @@ static int fops_release(struct inode *inode, struct file *file)
308 return 0; 308 return 0;
309} 309}
310 310
311static int fops_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) 311static int fops_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
312{ 312{
313/* 313/*
314 DEB_EE(("inode:%p, file:%p, cmd:%d, arg:%li\n",inode, file, cmd, arg)); 314 DEB_EE(("file:%p, cmd:%d, arg:%li\n", file, cmd, arg));
315*/ 315*/
316 return video_usercopy(file, cmd, arg, saa7146_video_do_ioctl); 316 return video_usercopy(file, cmd, arg, saa7146_video_do_ioctl);
317} 317}
@@ -416,7 +416,7 @@ static ssize_t fops_write(struct file *file, const char __user *data, size_t cou
416 } 416 }
417} 417}
418 418
419static const struct file_operations video_fops = 419static const struct v4l2_file_operations video_fops =
420{ 420{
421 .owner = THIS_MODULE, 421 .owner = THIS_MODULE,
422 .open = fops_open, 422 .open = fops_open,
@@ -426,7 +426,6 @@ static const struct file_operations video_fops =
426 .poll = fops_poll, 426 .poll = fops_poll,
427 .mmap = fops_mmap, 427 .mmap = fops_mmap,
428 .ioctl = fops_ioctl, 428 .ioctl = fops_ioctl,
429 .llseek = no_llseek,
430}; 429};
431 430
432static void vv_callback(struct saa7146_dev *dev, unsigned long status) 431static void vv_callback(struct saa7146_dev *dev, unsigned long status)