diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-08-23 07:32:09 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-12 07:36:54 -0400 |
commit | c170ecf434bceb0e188b14a6deb3bfa3ec9ef699 (patch) | |
tree | fa62c2e14adeff72310c9a6b8cba675f3153feed /drivers/media/video | |
parent | bfa8a273bb91078ea193ab94c717889928f3b925 (diff) |
V4L/DVB (8788): v4l: replace video_get_drvdata(video_devdata(filp)) with video_drvdata(filp)
Use the new video_drvdata(filp) function where it is safe to do so.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/cpia2/cpia2_v4l.c | 16 | ||||
-rw-r--r-- | drivers/media/video/et61x251/et61x251_core.c | 14 | ||||
-rw-r--r-- | drivers/media/video/saa5246a.c | 13 | ||||
-rw-r--r-- | drivers/media/video/saa5249.c | 12 | ||||
-rw-r--r-- | drivers/media/video/sn9c102/sn9c102_core.c | 14 | ||||
-rw-r--r-- | drivers/media/video/usbvideo/vicam.c | 3 | ||||
-rw-r--r-- | drivers/media/video/usbvision/usbvision-video.c | 122 | ||||
-rw-r--r-- | drivers/media/video/uvc/uvc_v4l2.c | 13 | ||||
-rw-r--r-- | drivers/media/video/vino.c | 18 | ||||
-rw-r--r-- | drivers/media/video/w9966.c | 12 | ||||
-rw-r--r-- | drivers/media/video/zc0301/zc0301_core.c | 14 |
11 files changed, 81 insertions, 170 deletions
diff --git a/drivers/media/video/cpia2/cpia2_v4l.c b/drivers/media/video/cpia2/cpia2_v4l.c index eb9f15cd4c45..897e8d1a5c3c 100644 --- a/drivers/media/video/cpia2/cpia2_v4l.c +++ b/drivers/media/video/cpia2/cpia2_v4l.c | |||
@@ -241,8 +241,7 @@ static struct v4l2_queryctrl controls[] = { | |||
241 | *****************************************************************************/ | 241 | *****************************************************************************/ |
242 | static int cpia2_open(struct inode *inode, struct file *file) | 242 | static int cpia2_open(struct inode *inode, struct file *file) |
243 | { | 243 | { |
244 | struct video_device *dev = video_devdata(file); | 244 | struct camera_data *cam = video_drvdata(file); |
245 | struct camera_data *cam = video_get_drvdata(dev); | ||
246 | int retval = 0; | 245 | int retval = 0; |
247 | 246 | ||
248 | if (!cam) { | 247 | if (!cam) { |
@@ -357,8 +356,7 @@ static int cpia2_close(struct inode *inode, struct file *file) | |||
357 | static ssize_t cpia2_v4l_read(struct file *file, char __user *buf, size_t count, | 356 | static ssize_t cpia2_v4l_read(struct file *file, char __user *buf, size_t count, |
358 | loff_t *off) | 357 | loff_t *off) |
359 | { | 358 | { |
360 | struct video_device *dev = video_devdata(file); | 359 | struct camera_data *cam = video_drvdata(file); |
361 | struct camera_data *cam = video_get_drvdata(dev); | ||
362 | int noblock = file->f_flags&O_NONBLOCK; | 360 | int noblock = file->f_flags&O_NONBLOCK; |
363 | 361 | ||
364 | struct cpia2_fh *fh = file->private_data; | 362 | struct cpia2_fh *fh = file->private_data; |
@@ -382,9 +380,7 @@ static ssize_t cpia2_v4l_read(struct file *file, char __user *buf, size_t count, | |||
382 | *****************************************************************************/ | 380 | *****************************************************************************/ |
383 | static unsigned int cpia2_v4l_poll(struct file *filp, struct poll_table_struct *wait) | 381 | static unsigned int cpia2_v4l_poll(struct file *filp, struct poll_table_struct *wait) |
384 | { | 382 | { |
385 | struct video_device *dev = video_devdata(filp); | 383 | struct camera_data *cam = video_drvdata(filp); |
386 | struct camera_data *cam = video_get_drvdata(dev); | ||
387 | |||
388 | struct cpia2_fh *fh = filp->private_data; | 384 | struct cpia2_fh *fh = filp->private_data; |
389 | 385 | ||
390 | if(!cam) | 386 | if(!cam) |
@@ -1579,8 +1575,7 @@ static int ioctl_dqbuf(void *arg,struct camera_data *cam, struct file *file) | |||
1579 | static int cpia2_do_ioctl(struct inode *inode, struct file *file, | 1575 | static int cpia2_do_ioctl(struct inode *inode, struct file *file, |
1580 | unsigned int ioctl_nr, void *arg) | 1576 | unsigned int ioctl_nr, void *arg) |
1581 | { | 1577 | { |
1582 | struct video_device *dev = video_devdata(file); | 1578 | struct camera_data *cam = video_drvdata(file); |
1583 | struct camera_data *cam = video_get_drvdata(dev); | ||
1584 | int retval = 0; | 1579 | int retval = 0; |
1585 | 1580 | ||
1586 | if (!cam) | 1581 | if (!cam) |
@@ -1860,9 +1855,8 @@ static int cpia2_ioctl(struct inode *inode, struct file *file, | |||
1860 | *****************************************************************************/ | 1855 | *****************************************************************************/ |
1861 | static int cpia2_mmap(struct file *file, struct vm_area_struct *area) | 1856 | static int cpia2_mmap(struct file *file, struct vm_area_struct *area) |
1862 | { | 1857 | { |
1858 | struct camera_data *cam = video_drvdata(file); | ||
1863 | int retval; | 1859 | int retval; |
1864 | struct video_device *dev = video_devdata(file); | ||
1865 | struct camera_data *cam = video_get_drvdata(dev); | ||
1866 | 1860 | ||
1867 | /* Priority check */ | 1861 | /* Priority check */ |
1868 | struct cpia2_fh *fh = file->private_data; | 1862 | struct cpia2_fh *fh = file->private_data; |
diff --git a/drivers/media/video/et61x251/et61x251_core.c b/drivers/media/video/et61x251/et61x251_core.c index 8db2a05bf9c5..7a85c41b0eea 100644 --- a/drivers/media/video/et61x251/et61x251_core.c +++ b/drivers/media/video/et61x251/et61x251_core.c | |||
@@ -1214,7 +1214,7 @@ static int et61x251_open(struct inode* inode, struct file* filp) | |||
1214 | if (!down_read_trylock(&et61x251_dev_lock)) | 1214 | if (!down_read_trylock(&et61x251_dev_lock)) |
1215 | return -ERESTARTSYS; | 1215 | return -ERESTARTSYS; |
1216 | 1216 | ||
1217 | cam = video_get_drvdata(video_devdata(filp)); | 1217 | cam = video_drvdata(filp); |
1218 | 1218 | ||
1219 | if (wait_for_completion_interruptible(&cam->probe)) { | 1219 | if (wait_for_completion_interruptible(&cam->probe)) { |
1220 | up_read(&et61x251_dev_lock); | 1220 | up_read(&et61x251_dev_lock); |
@@ -1297,7 +1297,7 @@ static int et61x251_release(struct inode* inode, struct file* filp) | |||
1297 | 1297 | ||
1298 | down_write(&et61x251_dev_lock); | 1298 | down_write(&et61x251_dev_lock); |
1299 | 1299 | ||
1300 | cam = video_get_drvdata(video_devdata(filp)); | 1300 | cam = video_drvdata(filp); |
1301 | 1301 | ||
1302 | et61x251_stop_transfer(cam); | 1302 | et61x251_stop_transfer(cam); |
1303 | et61x251_release_buffers(cam); | 1303 | et61x251_release_buffers(cam); |
@@ -1318,7 +1318,7 @@ static ssize_t | |||
1318 | et61x251_read(struct file* filp, char __user * buf, | 1318 | et61x251_read(struct file* filp, char __user * buf, |
1319 | size_t count, loff_t* f_pos) | 1319 | size_t count, loff_t* f_pos) |
1320 | { | 1320 | { |
1321 | struct et61x251_device* cam = video_get_drvdata(video_devdata(filp)); | 1321 | struct et61x251_device *cam = video_drvdata(filp); |
1322 | struct et61x251_frame_t* f, * i; | 1322 | struct et61x251_frame_t* f, * i; |
1323 | unsigned long lock_flags; | 1323 | unsigned long lock_flags; |
1324 | long timeout; | 1324 | long timeout; |
@@ -1426,7 +1426,7 @@ exit: | |||
1426 | 1426 | ||
1427 | static unsigned int et61x251_poll(struct file *filp, poll_table *wait) | 1427 | static unsigned int et61x251_poll(struct file *filp, poll_table *wait) |
1428 | { | 1428 | { |
1429 | struct et61x251_device* cam = video_get_drvdata(video_devdata(filp)); | 1429 | struct et61x251_device *cam = video_drvdata(filp); |
1430 | struct et61x251_frame_t* f; | 1430 | struct et61x251_frame_t* f; |
1431 | unsigned long lock_flags; | 1431 | unsigned long lock_flags; |
1432 | unsigned int mask = 0; | 1432 | unsigned int mask = 0; |
@@ -1502,7 +1502,7 @@ static struct vm_operations_struct et61x251_vm_ops = { | |||
1502 | 1502 | ||
1503 | static int et61x251_mmap(struct file* filp, struct vm_area_struct *vma) | 1503 | static int et61x251_mmap(struct file* filp, struct vm_area_struct *vma) |
1504 | { | 1504 | { |
1505 | struct et61x251_device* cam = video_get_drvdata(video_devdata(filp)); | 1505 | struct et61x251_device *cam = video_drvdata(filp); |
1506 | unsigned long size = vma->vm_end - vma->vm_start, | 1506 | unsigned long size = vma->vm_end - vma->vm_start, |
1507 | start = vma->vm_start; | 1507 | start = vma->vm_start; |
1508 | void *pos; | 1508 | void *pos; |
@@ -2395,7 +2395,7 @@ et61x251_vidioc_s_parm(struct et61x251_device* cam, void __user * arg) | |||
2395 | static int et61x251_ioctl_v4l2(struct inode* inode, struct file* filp, | 2395 | static int et61x251_ioctl_v4l2(struct inode* inode, struct file* filp, |
2396 | unsigned int cmd, void __user * arg) | 2396 | unsigned int cmd, void __user * arg) |
2397 | { | 2397 | { |
2398 | struct et61x251_device* cam = video_get_drvdata(video_devdata(filp)); | 2398 | struct et61x251_device *cam = video_drvdata(filp); |
2399 | 2399 | ||
2400 | switch (cmd) { | 2400 | switch (cmd) { |
2401 | 2401 | ||
@@ -2490,7 +2490,7 @@ static int et61x251_ioctl_v4l2(struct inode* inode, struct file* filp, | |||
2490 | static int et61x251_ioctl(struct inode* inode, struct file* filp, | 2490 | static int et61x251_ioctl(struct inode* inode, struct file* filp, |
2491 | unsigned int cmd, unsigned long arg) | 2491 | unsigned int cmd, unsigned long arg) |
2492 | { | 2492 | { |
2493 | struct et61x251_device* cam = video_get_drvdata(video_devdata(filp)); | 2493 | struct et61x251_device *cam = video_drvdata(filp); |
2494 | int err = 0; | 2494 | int err = 0; |
2495 | 2495 | ||
2496 | if (mutex_lock_interruptible(&cam->fileop_mutex)) | 2496 | if (mutex_lock_interruptible(&cam->fileop_mutex)) |
diff --git a/drivers/media/video/saa5246a.c b/drivers/media/video/saa5246a.c index 0178b49da0c1..ff81049e936d 100644 --- a/drivers/media/video/saa5246a.c +++ b/drivers/media/video/saa5246a.c | |||
@@ -149,6 +149,7 @@ static int saa5246a_probe(struct i2c_adapter *adap) | |||
149 | static int saa5246a_detach(struct i2c_client *client) | 149 | static int saa5246a_detach(struct i2c_client *client) |
150 | { | 150 | { |
151 | struct video_device *vd = i2c_get_clientdata(client); | 151 | struct video_device *vd = i2c_get_clientdata(client); |
152 | |||
152 | i2c_detach_client(client); | 153 | i2c_detach_client(client); |
153 | video_unregister_device(vd); | 154 | video_unregister_device(vd); |
154 | kfree(video_get_drvdata(vd)); | 155 | kfree(video_get_drvdata(vd)); |
@@ -581,8 +582,7 @@ static inline int saa5246a_stop_dau(struct saa5246a_device *t, | |||
581 | static int do_saa5246a_ioctl(struct inode *inode, struct file *file, | 582 | static int do_saa5246a_ioctl(struct inode *inode, struct file *file, |
582 | unsigned int cmd, void *arg) | 583 | unsigned int cmd, void *arg) |
583 | { | 584 | { |
584 | struct video_device *vd = video_devdata(file); | 585 | struct saa5246a_device *t = video_drvdata(file); |
585 | struct saa5246a_device *t = video_get_drvdata(vd); | ||
586 | 586 | ||
587 | switch(cmd) | 587 | switch(cmd) |
588 | { | 588 | { |
@@ -723,8 +723,7 @@ static inline unsigned int vtx_fix_command(unsigned int cmd) | |||
723 | static int saa5246a_ioctl(struct inode *inode, struct file *file, | 723 | static int saa5246a_ioctl(struct inode *inode, struct file *file, |
724 | unsigned int cmd, unsigned long arg) | 724 | unsigned int cmd, unsigned long arg) |
725 | { | 725 | { |
726 | struct video_device *vd = video_devdata(file); | 726 | struct saa5246a_device *t = video_drvdata(file); |
727 | struct saa5246a_device *t = video_get_drvdata(vd); | ||
728 | int err; | 727 | int err; |
729 | 728 | ||
730 | cmd = vtx_fix_command(cmd); | 729 | cmd = vtx_fix_command(cmd); |
@@ -736,8 +735,7 @@ static int saa5246a_ioctl(struct inode *inode, struct file *file, | |||
736 | 735 | ||
737 | static int saa5246a_open(struct inode *inode, struct file *file) | 736 | static int saa5246a_open(struct inode *inode, struct file *file) |
738 | { | 737 | { |
739 | struct video_device *vd = video_devdata(file); | 738 | struct saa5246a_device *t = video_drvdata(file); |
740 | struct saa5246a_device *t = video_get_drvdata(vd); | ||
741 | 739 | ||
742 | if (t->client == NULL) | 740 | if (t->client == NULL) |
743 | return -ENODEV; | 741 | return -ENODEV; |
@@ -779,8 +777,7 @@ static int saa5246a_open(struct inode *inode, struct file *file) | |||
779 | 777 | ||
780 | static int saa5246a_release(struct inode *inode, struct file *file) | 778 | static int saa5246a_release(struct inode *inode, struct file *file) |
781 | { | 779 | { |
782 | struct video_device *vd = video_devdata(file); | 780 | struct saa5246a_device *t = video_drvdata(file); |
783 | struct saa5246a_device *t = video_get_drvdata(vd); | ||
784 | 781 | ||
785 | /* Stop all acquisition circuits. */ | 782 | /* Stop all acquisition circuits. */ |
786 | i2c_senddata(t, SAA5246A_REGISTER_R1, | 783 | i2c_senddata(t, SAA5246A_REGISTER_R1, |
diff --git a/drivers/media/video/saa5249.c b/drivers/media/video/saa5249.c index c784715a0b04..8517aa4f0681 100644 --- a/drivers/media/video/saa5249.c +++ b/drivers/media/video/saa5249.c | |||
@@ -319,8 +319,7 @@ static int do_saa5249_ioctl(struct inode *inode, struct file *file, | |||
319 | unsigned int cmd, void *arg) | 319 | unsigned int cmd, void *arg) |
320 | { | 320 | { |
321 | static int virtual_mode = false; | 321 | static int virtual_mode = false; |
322 | struct video_device *vd = video_devdata(file); | 322 | struct saa5249_device *t = video_drvdata(file); |
323 | struct saa5249_device *t = video_get_drvdata(vd); | ||
324 | 323 | ||
325 | switch(cmd) | 324 | switch(cmd) |
326 | { | 325 | { |
@@ -618,8 +617,7 @@ static inline unsigned int vtx_fix_command(unsigned int cmd) | |||
618 | static int saa5249_ioctl(struct inode *inode, struct file *file, | 617 | static int saa5249_ioctl(struct inode *inode, struct file *file, |
619 | unsigned int cmd, unsigned long arg) | 618 | unsigned int cmd, unsigned long arg) |
620 | { | 619 | { |
621 | struct video_device *vd = video_devdata(file); | 620 | struct saa5249_device *t = video_drvdata(file); |
622 | struct saa5249_device *t = video_get_drvdata(vd); | ||
623 | int err; | 621 | int err; |
624 | 622 | ||
625 | cmd = vtx_fix_command(cmd); | 623 | cmd = vtx_fix_command(cmd); |
@@ -631,8 +629,7 @@ static int saa5249_ioctl(struct inode *inode, struct file *file, | |||
631 | 629 | ||
632 | static int saa5249_open(struct inode *inode, struct file *file) | 630 | static int saa5249_open(struct inode *inode, struct file *file) |
633 | { | 631 | { |
634 | struct video_device *vd = video_devdata(file); | 632 | struct saa5249_device *t = video_drvdata(file); |
635 | struct saa5249_device *t = video_get_drvdata(vd); | ||
636 | int pgbuf; | 633 | int pgbuf; |
637 | 634 | ||
638 | if (t->client == NULL) | 635 | if (t->client == NULL) |
@@ -669,8 +666,7 @@ static int saa5249_open(struct inode *inode, struct file *file) | |||
669 | 666 | ||
670 | static int saa5249_release(struct inode *inode, struct file *file) | 667 | static int saa5249_release(struct inode *inode, struct file *file) |
671 | { | 668 | { |
672 | struct video_device *vd = video_devdata(file); | 669 | struct saa5249_device *t = video_drvdata(file); |
673 | struct saa5249_device *t = video_get_drvdata(vd); | ||
674 | 670 | ||
675 | i2c_senddata(t, 1, 0x20, -1); /* Turn off CCT */ | 671 | i2c_senddata(t, 1, 0x20, -1); /* Turn off CCT */ |
676 | i2c_senddata(t, 5, 3, 3, -1); /* Turn off TV-display */ | 672 | i2c_senddata(t, 5, 3, 3, -1); /* Turn off TV-display */ |
diff --git a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c index 2da6938718f2..4b76c45c148c 100644 --- a/drivers/media/video/sn9c102/sn9c102_core.c +++ b/drivers/media/video/sn9c102/sn9c102_core.c | |||
@@ -1746,7 +1746,7 @@ static int sn9c102_open(struct inode* inode, struct file* filp) | |||
1746 | if (!down_read_trylock(&sn9c102_dev_lock)) | 1746 | if (!down_read_trylock(&sn9c102_dev_lock)) |
1747 | return -ERESTARTSYS; | 1747 | return -ERESTARTSYS; |
1748 | 1748 | ||
1749 | cam = video_get_drvdata(video_devdata(filp)); | 1749 | cam = video_drvdata(filp); |
1750 | 1750 | ||
1751 | if (wait_for_completion_interruptible(&cam->probe)) { | 1751 | if (wait_for_completion_interruptible(&cam->probe)) { |
1752 | up_read(&sn9c102_dev_lock); | 1752 | up_read(&sn9c102_dev_lock); |
@@ -1843,7 +1843,7 @@ static int sn9c102_release(struct inode* inode, struct file* filp) | |||
1843 | 1843 | ||
1844 | down_write(&sn9c102_dev_lock); | 1844 | down_write(&sn9c102_dev_lock); |
1845 | 1845 | ||
1846 | cam = video_get_drvdata(video_devdata(filp)); | 1846 | cam = video_drvdata(filp); |
1847 | 1847 | ||
1848 | sn9c102_stop_transfer(cam); | 1848 | sn9c102_stop_transfer(cam); |
1849 | sn9c102_release_buffers(cam); | 1849 | sn9c102_release_buffers(cam); |
@@ -1863,7 +1863,7 @@ static int sn9c102_release(struct inode* inode, struct file* filp) | |||
1863 | static ssize_t | 1863 | static ssize_t |
1864 | sn9c102_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos) | 1864 | sn9c102_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos) |
1865 | { | 1865 | { |
1866 | struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp)); | 1866 | struct sn9c102_device *cam = video_drvdata(filp); |
1867 | struct sn9c102_frame_t* f, * i; | 1867 | struct sn9c102_frame_t* f, * i; |
1868 | unsigned long lock_flags; | 1868 | unsigned long lock_flags; |
1869 | long timeout; | 1869 | long timeout; |
@@ -1987,7 +1987,7 @@ exit: | |||
1987 | 1987 | ||
1988 | static unsigned int sn9c102_poll(struct file *filp, poll_table *wait) | 1988 | static unsigned int sn9c102_poll(struct file *filp, poll_table *wait) |
1989 | { | 1989 | { |
1990 | struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp)); | 1990 | struct sn9c102_device *cam = video_drvdata(filp); |
1991 | struct sn9c102_frame_t* f; | 1991 | struct sn9c102_frame_t* f; |
1992 | unsigned long lock_flags; | 1992 | unsigned long lock_flags; |
1993 | unsigned int mask = 0; | 1993 | unsigned int mask = 0; |
@@ -2063,7 +2063,7 @@ static struct vm_operations_struct sn9c102_vm_ops = { | |||
2063 | 2063 | ||
2064 | static int sn9c102_mmap(struct file* filp, struct vm_area_struct *vma) | 2064 | static int sn9c102_mmap(struct file* filp, struct vm_area_struct *vma) |
2065 | { | 2065 | { |
2066 | struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp)); | 2066 | struct sn9c102_device *cam = video_drvdata(filp); |
2067 | unsigned long size = vma->vm_end - vma->vm_start, | 2067 | unsigned long size = vma->vm_end - vma->vm_start, |
2068 | start = vma->vm_start; | 2068 | start = vma->vm_start; |
2069 | void *pos; | 2069 | void *pos; |
@@ -3075,7 +3075,7 @@ sn9c102_vidioc_s_audio(struct sn9c102_device* cam, void __user * arg) | |||
3075 | static int sn9c102_ioctl_v4l2(struct inode* inode, struct file* filp, | 3075 | static int sn9c102_ioctl_v4l2(struct inode* inode, struct file* filp, |
3076 | unsigned int cmd, void __user * arg) | 3076 | unsigned int cmd, void __user * arg) |
3077 | { | 3077 | { |
3078 | struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp)); | 3078 | struct sn9c102_device *cam = video_drvdata(filp); |
3079 | 3079 | ||
3080 | switch (cmd) { | 3080 | switch (cmd) { |
3081 | 3081 | ||
@@ -3179,7 +3179,7 @@ static int sn9c102_ioctl_v4l2(struct inode* inode, struct file* filp, | |||
3179 | static int sn9c102_ioctl(struct inode* inode, struct file* filp, | 3179 | static int sn9c102_ioctl(struct inode* inode, struct file* filp, |
3180 | unsigned int cmd, unsigned long arg) | 3180 | unsigned int cmd, unsigned long arg) |
3181 | { | 3181 | { |
3182 | struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp)); | 3182 | struct sn9c102_device *cam = video_drvdata(filp); |
3183 | int err = 0; | 3183 | int err = 0; |
3184 | 3184 | ||
3185 | if (mutex_lock_interruptible(&cam->fileop_mutex)) | 3185 | if (mutex_lock_interruptible(&cam->fileop_mutex)) |
diff --git a/drivers/media/video/usbvideo/vicam.c b/drivers/media/video/usbvideo/vicam.c index 1ffcc393fcbb..7a127d6bfdee 100644 --- a/drivers/media/video/usbvideo/vicam.c +++ b/drivers/media/video/usbvideo/vicam.c | |||
@@ -472,8 +472,7 @@ vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsign | |||
472 | static int | 472 | static int |
473 | vicam_open(struct inode *inode, struct file *file) | 473 | vicam_open(struct inode *inode, struct file *file) |
474 | { | 474 | { |
475 | struct video_device *dev = video_devdata(file); | 475 | struct vicam_camera *cam = video_drvdata(file); |
476 | struct vicam_camera *cam = video_get_drvdata(dev); | ||
477 | 476 | ||
478 | DBG("open\n"); | 477 | DBG("open\n"); |
479 | 478 | ||
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c index b76295a5be8b..782ee643601c 100644 --- a/drivers/media/video/usbvision/usbvision-video.c +++ b/drivers/media/video/usbvision/usbvision-video.c | |||
@@ -360,9 +360,7 @@ static void usbvision_remove_sysfs(struct video_device *vdev) | |||
360 | */ | 360 | */ |
361 | static int usbvision_v4l2_open(struct inode *inode, struct file *file) | 361 | static int usbvision_v4l2_open(struct inode *inode, struct file *file) |
362 | { | 362 | { |
363 | struct video_device *dev = video_devdata(file); | 363 | struct usb_usbvision *usbvision = video_drvdata(file); |
364 | struct usb_usbvision *usbvision = | ||
365 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
366 | int errCode = 0; | 364 | int errCode = 0; |
367 | 365 | ||
368 | PDEBUG(DBG_IO, "open"); | 366 | PDEBUG(DBG_IO, "open"); |
@@ -439,9 +437,7 @@ static int usbvision_v4l2_open(struct inode *inode, struct file *file) | |||
439 | */ | 437 | */ |
440 | static int usbvision_v4l2_close(struct inode *inode, struct file *file) | 438 | static int usbvision_v4l2_close(struct inode *inode, struct file *file) |
441 | { | 439 | { |
442 | struct video_device *dev = video_devdata(file); | 440 | struct usb_usbvision *usbvision = video_drvdata(file); |
443 | struct usb_usbvision *usbvision = | ||
444 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
445 | 441 | ||
446 | PDEBUG(DBG_IO, "close"); | 442 | PDEBUG(DBG_IO, "close"); |
447 | mutex_lock(&usbvision->lock); | 443 | mutex_lock(&usbvision->lock); |
@@ -486,9 +482,7 @@ static int usbvision_v4l2_close(struct inode *inode, struct file *file) | |||
486 | static int vidioc_g_register (struct file *file, void *priv, | 482 | static int vidioc_g_register (struct file *file, void *priv, |
487 | struct v4l2_register *reg) | 483 | struct v4l2_register *reg) |
488 | { | 484 | { |
489 | struct video_device *dev = video_devdata(file); | 485 | struct usb_usbvision *usbvision = video_drvdata(file); |
490 | struct usb_usbvision *usbvision = | ||
491 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
492 | int errCode; | 486 | int errCode; |
493 | 487 | ||
494 | if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) | 488 | if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) |
@@ -507,9 +501,7 @@ static int vidioc_g_register (struct file *file, void *priv, | |||
507 | static int vidioc_s_register (struct file *file, void *priv, | 501 | static int vidioc_s_register (struct file *file, void *priv, |
508 | struct v4l2_register *reg) | 502 | struct v4l2_register *reg) |
509 | { | 503 | { |
510 | struct video_device *dev = video_devdata(file); | 504 | struct usb_usbvision *usbvision = video_drvdata(file); |
511 | struct usb_usbvision *usbvision = | ||
512 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
513 | int errCode; | 505 | int errCode; |
514 | 506 | ||
515 | if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) | 507 | if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) |
@@ -528,9 +520,7 @@ static int vidioc_s_register (struct file *file, void *priv, | |||
528 | static int vidioc_querycap (struct file *file, void *priv, | 520 | static int vidioc_querycap (struct file *file, void *priv, |
529 | struct v4l2_capability *vc) | 521 | struct v4l2_capability *vc) |
530 | { | 522 | { |
531 | struct video_device *dev = video_devdata(file); | 523 | struct usb_usbvision *usbvision = video_drvdata(file); |
532 | struct usb_usbvision *usbvision = | ||
533 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
534 | 524 | ||
535 | strlcpy(vc->driver, "USBVision", sizeof(vc->driver)); | 525 | strlcpy(vc->driver, "USBVision", sizeof(vc->driver)); |
536 | strlcpy(vc->card, | 526 | strlcpy(vc->card, |
@@ -550,9 +540,7 @@ static int vidioc_querycap (struct file *file, void *priv, | |||
550 | static int vidioc_enum_input (struct file *file, void *priv, | 540 | static int vidioc_enum_input (struct file *file, void *priv, |
551 | struct v4l2_input *vi) | 541 | struct v4l2_input *vi) |
552 | { | 542 | { |
553 | struct video_device *dev = video_devdata(file); | 543 | struct usb_usbvision *usbvision = video_drvdata(file); |
554 | struct usb_usbvision *usbvision = | ||
555 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
556 | int chan; | 544 | int chan; |
557 | 545 | ||
558 | if ((vi->index >= usbvision->video_inputs) || (vi->index < 0) ) | 546 | if ((vi->index >= usbvision->video_inputs) || (vi->index < 0) ) |
@@ -605,9 +593,7 @@ static int vidioc_enum_input (struct file *file, void *priv, | |||
605 | 593 | ||
606 | static int vidioc_g_input (struct file *file, void *priv, unsigned int *input) | 594 | static int vidioc_g_input (struct file *file, void *priv, unsigned int *input) |
607 | { | 595 | { |
608 | struct video_device *dev = video_devdata(file); | 596 | struct usb_usbvision *usbvision = video_drvdata(file); |
609 | struct usb_usbvision *usbvision = | ||
610 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
611 | 597 | ||
612 | *input = usbvision->ctl_input; | 598 | *input = usbvision->ctl_input; |
613 | return 0; | 599 | return 0; |
@@ -615,9 +601,7 @@ static int vidioc_g_input (struct file *file, void *priv, unsigned int *input) | |||
615 | 601 | ||
616 | static int vidioc_s_input (struct file *file, void *priv, unsigned int input) | 602 | static int vidioc_s_input (struct file *file, void *priv, unsigned int input) |
617 | { | 603 | { |
618 | struct video_device *dev = video_devdata(file); | 604 | struct usb_usbvision *usbvision = video_drvdata(file); |
619 | struct usb_usbvision *usbvision = | ||
620 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
621 | 605 | ||
622 | if ((input >= usbvision->video_inputs) || (input < 0) ) | 606 | if ((input >= usbvision->video_inputs) || (input < 0) ) |
623 | return -EINVAL; | 607 | return -EINVAL; |
@@ -634,9 +618,8 @@ static int vidioc_s_input (struct file *file, void *priv, unsigned int input) | |||
634 | 618 | ||
635 | static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *id) | 619 | static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *id) |
636 | { | 620 | { |
637 | struct video_device *dev = video_devdata(file); | 621 | struct usb_usbvision *usbvision = video_drvdata(file); |
638 | struct usb_usbvision *usbvision = | 622 | |
639 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
640 | usbvision->tvnormId=*id; | 623 | usbvision->tvnormId=*id; |
641 | 624 | ||
642 | mutex_lock(&usbvision->lock); | 625 | mutex_lock(&usbvision->lock); |
@@ -652,9 +635,7 @@ static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *id) | |||
652 | static int vidioc_g_tuner (struct file *file, void *priv, | 635 | static int vidioc_g_tuner (struct file *file, void *priv, |
653 | struct v4l2_tuner *vt) | 636 | struct v4l2_tuner *vt) |
654 | { | 637 | { |
655 | struct video_device *dev = video_devdata(file); | 638 | struct usb_usbvision *usbvision = video_drvdata(file); |
656 | struct usb_usbvision *usbvision = | ||
657 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
658 | 639 | ||
659 | if (!usbvision->have_tuner || vt->index) // Only tuner 0 | 640 | if (!usbvision->have_tuner || vt->index) // Only tuner 0 |
660 | return -EINVAL; | 641 | return -EINVAL; |
@@ -673,9 +654,7 @@ static int vidioc_g_tuner (struct file *file, void *priv, | |||
673 | static int vidioc_s_tuner (struct file *file, void *priv, | 654 | static int vidioc_s_tuner (struct file *file, void *priv, |
674 | struct v4l2_tuner *vt) | 655 | struct v4l2_tuner *vt) |
675 | { | 656 | { |
676 | struct video_device *dev = video_devdata(file); | 657 | struct usb_usbvision *usbvision = video_drvdata(file); |
677 | struct usb_usbvision *usbvision = | ||
678 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
679 | 658 | ||
680 | // Only no or one tuner for now | 659 | // Only no or one tuner for now |
681 | if (!usbvision->have_tuner || vt->index) | 660 | if (!usbvision->have_tuner || vt->index) |
@@ -689,9 +668,7 @@ static int vidioc_s_tuner (struct file *file, void *priv, | |||
689 | static int vidioc_g_frequency (struct file *file, void *priv, | 668 | static int vidioc_g_frequency (struct file *file, void *priv, |
690 | struct v4l2_frequency *freq) | 669 | struct v4l2_frequency *freq) |
691 | { | 670 | { |
692 | struct video_device *dev = video_devdata(file); | 671 | struct usb_usbvision *usbvision = video_drvdata(file); |
693 | struct usb_usbvision *usbvision = | ||
694 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
695 | 672 | ||
696 | freq->tuner = 0; // Only one tuner | 673 | freq->tuner = 0; // Only one tuner |
697 | if(usbvision->radio) { | 674 | if(usbvision->radio) { |
@@ -707,9 +684,7 @@ static int vidioc_g_frequency (struct file *file, void *priv, | |||
707 | static int vidioc_s_frequency (struct file *file, void *priv, | 684 | static int vidioc_s_frequency (struct file *file, void *priv, |
708 | struct v4l2_frequency *freq) | 685 | struct v4l2_frequency *freq) |
709 | { | 686 | { |
710 | struct video_device *dev = video_devdata(file); | 687 | struct usb_usbvision *usbvision = video_drvdata(file); |
711 | struct usb_usbvision *usbvision = | ||
712 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
713 | 688 | ||
714 | // Only no or one tuner for now | 689 | // Only no or one tuner for now |
715 | if (!usbvision->have_tuner || freq->tuner) | 690 | if (!usbvision->have_tuner || freq->tuner) |
@@ -723,9 +698,7 @@ static int vidioc_s_frequency (struct file *file, void *priv, | |||
723 | 698 | ||
724 | static int vidioc_g_audio (struct file *file, void *priv, struct v4l2_audio *a) | 699 | static int vidioc_g_audio (struct file *file, void *priv, struct v4l2_audio *a) |
725 | { | 700 | { |
726 | struct video_device *dev = video_devdata(file); | 701 | struct usb_usbvision *usbvision = video_drvdata(file); |
727 | struct usb_usbvision *usbvision = | ||
728 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
729 | 702 | ||
730 | memset(a,0,sizeof(*a)); | 703 | memset(a,0,sizeof(*a)); |
731 | if(usbvision->radio) { | 704 | if(usbvision->radio) { |
@@ -750,9 +723,7 @@ static int vidioc_s_audio (struct file *file, void *fh, | |||
750 | static int vidioc_queryctrl (struct file *file, void *priv, | 723 | static int vidioc_queryctrl (struct file *file, void *priv, |
751 | struct v4l2_queryctrl *ctrl) | 724 | struct v4l2_queryctrl *ctrl) |
752 | { | 725 | { |
753 | struct video_device *dev = video_devdata(file); | 726 | struct usb_usbvision *usbvision = video_drvdata(file); |
754 | struct usb_usbvision *usbvision = | ||
755 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
756 | int id=ctrl->id; | 727 | int id=ctrl->id; |
757 | 728 | ||
758 | memset(ctrl,0,sizeof(*ctrl)); | 729 | memset(ctrl,0,sizeof(*ctrl)); |
@@ -769,9 +740,7 @@ static int vidioc_queryctrl (struct file *file, void *priv, | |||
769 | static int vidioc_g_ctrl (struct file *file, void *priv, | 740 | static int vidioc_g_ctrl (struct file *file, void *priv, |
770 | struct v4l2_control *ctrl) | 741 | struct v4l2_control *ctrl) |
771 | { | 742 | { |
772 | struct video_device *dev = video_devdata(file); | 743 | struct usb_usbvision *usbvision = video_drvdata(file); |
773 | struct usb_usbvision *usbvision = | ||
774 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
775 | call_i2c_clients(usbvision, VIDIOC_G_CTRL, ctrl); | 744 | call_i2c_clients(usbvision, VIDIOC_G_CTRL, ctrl); |
776 | 745 | ||
777 | return 0; | 746 | return 0; |
@@ -780,9 +749,7 @@ static int vidioc_g_ctrl (struct file *file, void *priv, | |||
780 | static int vidioc_s_ctrl (struct file *file, void *priv, | 749 | static int vidioc_s_ctrl (struct file *file, void *priv, |
781 | struct v4l2_control *ctrl) | 750 | struct v4l2_control *ctrl) |
782 | { | 751 | { |
783 | struct video_device *dev = video_devdata(file); | 752 | struct usb_usbvision *usbvision = video_drvdata(file); |
784 | struct usb_usbvision *usbvision = | ||
785 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
786 | call_i2c_clients(usbvision, VIDIOC_S_CTRL, ctrl); | 753 | call_i2c_clients(usbvision, VIDIOC_S_CTRL, ctrl); |
787 | 754 | ||
788 | return 0; | 755 | return 0; |
@@ -791,9 +758,7 @@ static int vidioc_s_ctrl (struct file *file, void *priv, | |||
791 | static int vidioc_reqbufs (struct file *file, | 758 | static int vidioc_reqbufs (struct file *file, |
792 | void *priv, struct v4l2_requestbuffers *vr) | 759 | void *priv, struct v4l2_requestbuffers *vr) |
793 | { | 760 | { |
794 | struct video_device *dev = video_devdata(file); | 761 | struct usb_usbvision *usbvision = video_drvdata(file); |
795 | struct usb_usbvision *usbvision = | ||
796 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
797 | int ret; | 762 | int ret; |
798 | 763 | ||
799 | RESTRICT_TO_RANGE(vr->count,1,USBVISION_NUMFRAMES); | 764 | RESTRICT_TO_RANGE(vr->count,1,USBVISION_NUMFRAMES); |
@@ -821,9 +786,7 @@ static int vidioc_reqbufs (struct file *file, | |||
821 | static int vidioc_querybuf (struct file *file, | 786 | static int vidioc_querybuf (struct file *file, |
822 | void *priv, struct v4l2_buffer *vb) | 787 | void *priv, struct v4l2_buffer *vb) |
823 | { | 788 | { |
824 | struct video_device *dev = video_devdata(file); | 789 | struct usb_usbvision *usbvision = video_drvdata(file); |
825 | struct usb_usbvision *usbvision = | ||
826 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
827 | struct usbvision_frame *frame; | 790 | struct usbvision_frame *frame; |
828 | 791 | ||
829 | /* FIXME : must control | 792 | /* FIXME : must control |
@@ -859,9 +822,7 @@ static int vidioc_querybuf (struct file *file, | |||
859 | 822 | ||
860 | static int vidioc_qbuf (struct file *file, void *priv, struct v4l2_buffer *vb) | 823 | static int vidioc_qbuf (struct file *file, void *priv, struct v4l2_buffer *vb) |
861 | { | 824 | { |
862 | struct video_device *dev = video_devdata(file); | 825 | struct usb_usbvision *usbvision = video_drvdata(file); |
863 | struct usb_usbvision *usbvision = | ||
864 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
865 | struct usbvision_frame *frame; | 826 | struct usbvision_frame *frame; |
866 | unsigned long lock_flags; | 827 | unsigned long lock_flags; |
867 | 828 | ||
@@ -898,9 +859,7 @@ static int vidioc_qbuf (struct file *file, void *priv, struct v4l2_buffer *vb) | |||
898 | 859 | ||
899 | static int vidioc_dqbuf (struct file *file, void *priv, struct v4l2_buffer *vb) | 860 | static int vidioc_dqbuf (struct file *file, void *priv, struct v4l2_buffer *vb) |
900 | { | 861 | { |
901 | struct video_device *dev = video_devdata(file); | 862 | struct usb_usbvision *usbvision = video_drvdata(file); |
902 | struct usb_usbvision *usbvision = | ||
903 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
904 | int ret; | 863 | int ret; |
905 | struct usbvision_frame *f; | 864 | struct usbvision_frame *f; |
906 | unsigned long lock_flags; | 865 | unsigned long lock_flags; |
@@ -941,9 +900,7 @@ static int vidioc_dqbuf (struct file *file, void *priv, struct v4l2_buffer *vb) | |||
941 | 900 | ||
942 | static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i) | 901 | static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i) |
943 | { | 902 | { |
944 | struct video_device *dev = video_devdata(file); | 903 | struct usb_usbvision *usbvision = video_drvdata(file); |
945 | struct usb_usbvision *usbvision = | ||
946 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
947 | int b=V4L2_BUF_TYPE_VIDEO_CAPTURE; | 904 | int b=V4L2_BUF_TYPE_VIDEO_CAPTURE; |
948 | 905 | ||
949 | usbvision->streaming = Stream_On; | 906 | usbvision->streaming = Stream_On; |
@@ -955,9 +912,7 @@ static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i) | |||
955 | static int vidioc_streamoff(struct file *file, | 912 | static int vidioc_streamoff(struct file *file, |
956 | void *priv, enum v4l2_buf_type type) | 913 | void *priv, enum v4l2_buf_type type) |
957 | { | 914 | { |
958 | struct video_device *dev = video_devdata(file); | 915 | struct usb_usbvision *usbvision = video_drvdata(file); |
959 | struct usb_usbvision *usbvision = | ||
960 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
961 | int b=V4L2_BUF_TYPE_VIDEO_CAPTURE; | 916 | int b=V4L2_BUF_TYPE_VIDEO_CAPTURE; |
962 | 917 | ||
963 | if (type != V4L2_BUF_TYPE_VIDEO_CAPTURE) | 918 | if (type != V4L2_BUF_TYPE_VIDEO_CAPTURE) |
@@ -990,9 +945,7 @@ static int vidioc_enum_fmt_vid_cap (struct file *file, void *priv, | |||
990 | static int vidioc_g_fmt_vid_cap (struct file *file, void *priv, | 945 | static int vidioc_g_fmt_vid_cap (struct file *file, void *priv, |
991 | struct v4l2_format *vf) | 946 | struct v4l2_format *vf) |
992 | { | 947 | { |
993 | struct video_device *dev = video_devdata(file); | 948 | struct usb_usbvision *usbvision = video_drvdata(file); |
994 | struct usb_usbvision *usbvision = | ||
995 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
996 | vf->fmt.pix.width = usbvision->curwidth; | 949 | vf->fmt.pix.width = usbvision->curwidth; |
997 | vf->fmt.pix.height = usbvision->curheight; | 950 | vf->fmt.pix.height = usbvision->curheight; |
998 | vf->fmt.pix.pixelformat = usbvision->palette.format; | 951 | vf->fmt.pix.pixelformat = usbvision->palette.format; |
@@ -1008,9 +961,7 @@ static int vidioc_g_fmt_vid_cap (struct file *file, void *priv, | |||
1008 | static int vidioc_try_fmt_vid_cap (struct file *file, void *priv, | 961 | static int vidioc_try_fmt_vid_cap (struct file *file, void *priv, |
1009 | struct v4l2_format *vf) | 962 | struct v4l2_format *vf) |
1010 | { | 963 | { |
1011 | struct video_device *dev = video_devdata(file); | 964 | struct usb_usbvision *usbvision = video_drvdata(file); |
1012 | struct usb_usbvision *usbvision = | ||
1013 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
1014 | int formatIdx; | 965 | int formatIdx; |
1015 | 966 | ||
1016 | /* Find requested format in available ones */ | 967 | /* Find requested format in available ones */ |
@@ -1038,9 +989,7 @@ static int vidioc_try_fmt_vid_cap (struct file *file, void *priv, | |||
1038 | static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, | 989 | static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, |
1039 | struct v4l2_format *vf) | 990 | struct v4l2_format *vf) |
1040 | { | 991 | { |
1041 | struct video_device *dev = video_devdata(file); | 992 | struct usb_usbvision *usbvision = video_drvdata(file); |
1042 | struct usb_usbvision *usbvision = | ||
1043 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
1044 | int ret; | 993 | int ret; |
1045 | 994 | ||
1046 | if( 0 != (ret=vidioc_try_fmt_vid_cap (file, priv, vf)) ) { | 995 | if( 0 != (ret=vidioc_try_fmt_vid_cap (file, priv, vf)) ) { |
@@ -1068,9 +1017,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, | |||
1068 | static ssize_t usbvision_v4l2_read(struct file *file, char __user *buf, | 1017 | static ssize_t usbvision_v4l2_read(struct file *file, char __user *buf, |
1069 | size_t count, loff_t *ppos) | 1018 | size_t count, loff_t *ppos) |
1070 | { | 1019 | { |
1071 | struct video_device *dev = video_devdata(file); | 1020 | struct usb_usbvision *usbvision = video_drvdata(file); |
1072 | struct usb_usbvision *usbvision = | ||
1073 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
1074 | int noblock = file->f_flags & O_NONBLOCK; | 1021 | int noblock = file->f_flags & O_NONBLOCK; |
1075 | unsigned long lock_flags; | 1022 | unsigned long lock_flags; |
1076 | 1023 | ||
@@ -1179,10 +1126,7 @@ static int usbvision_v4l2_mmap(struct file *file, struct vm_area_struct *vma) | |||
1179 | start = vma->vm_start; | 1126 | start = vma->vm_start; |
1180 | void *pos; | 1127 | void *pos; |
1181 | u32 i; | 1128 | u32 i; |
1182 | 1129 | struct usb_usbvision *usbvision = video_drvdata(file); | |
1183 | struct video_device *dev = video_devdata(file); | ||
1184 | struct usb_usbvision *usbvision = | ||
1185 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
1186 | 1130 | ||
1187 | PDEBUG(DBG_MMAP, "mmap"); | 1131 | PDEBUG(DBG_MMAP, "mmap"); |
1188 | 1132 | ||
@@ -1239,9 +1183,7 @@ static int usbvision_v4l2_mmap(struct file *file, struct vm_area_struct *vma) | |||
1239 | */ | 1183 | */ |
1240 | static int usbvision_radio_open(struct inode *inode, struct file *file) | 1184 | static int usbvision_radio_open(struct inode *inode, struct file *file) |
1241 | { | 1185 | { |
1242 | struct video_device *dev = video_devdata(file); | 1186 | struct usb_usbvision *usbvision = video_drvdata(file); |
1243 | struct usb_usbvision *usbvision = | ||
1244 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
1245 | int errCode = 0; | 1187 | int errCode = 0; |
1246 | 1188 | ||
1247 | PDEBUG(DBG_IO, "%s:", __func__); | 1189 | PDEBUG(DBG_IO, "%s:", __func__); |
@@ -1291,9 +1233,7 @@ out: | |||
1291 | 1233 | ||
1292 | static int usbvision_radio_close(struct inode *inode, struct file *file) | 1234 | static int usbvision_radio_close(struct inode *inode, struct file *file) |
1293 | { | 1235 | { |
1294 | struct video_device *dev = video_devdata(file); | 1236 | struct usb_usbvision *usbvision = video_drvdata(file); |
1295 | struct usb_usbvision *usbvision = | ||
1296 | (struct usb_usbvision *) video_get_drvdata(dev); | ||
1297 | int errCode = 0; | 1237 | int errCode = 0; |
1298 | 1238 | ||
1299 | PDEBUG(DBG_IO, ""); | 1239 | PDEBUG(DBG_IO, ""); |
diff --git a/drivers/media/video/uvc/uvc_v4l2.c b/drivers/media/video/uvc/uvc_v4l2.c index d7bd71be40a9..d4758c8e13ad 100644 --- a/drivers/media/video/uvc/uvc_v4l2.c +++ b/drivers/media/video/uvc/uvc_v4l2.c | |||
@@ -400,15 +400,13 @@ static int uvc_has_privileges(struct uvc_fh *handle) | |||
400 | 400 | ||
401 | static int uvc_v4l2_open(struct inode *inode, struct file *file) | 401 | static int uvc_v4l2_open(struct inode *inode, struct file *file) |
402 | { | 402 | { |
403 | struct video_device *vdev; | ||
404 | struct uvc_video_device *video; | 403 | struct uvc_video_device *video; |
405 | struct uvc_fh *handle; | 404 | struct uvc_fh *handle; |
406 | int ret = 0; | 405 | int ret = 0; |
407 | 406 | ||
408 | uvc_trace(UVC_TRACE_CALLS, "uvc_v4l2_open\n"); | 407 | uvc_trace(UVC_TRACE_CALLS, "uvc_v4l2_open\n"); |
409 | mutex_lock(&uvc_driver.open_mutex); | 408 | mutex_lock(&uvc_driver.open_mutex); |
410 | vdev = video_devdata(file); | 409 | video = video_drvdata(file); |
411 | video = video_get_drvdata(vdev); | ||
412 | 410 | ||
413 | if (video->dev->state & UVC_DEV_DISCONNECTED) { | 411 | if (video->dev->state & UVC_DEV_DISCONNECTED) { |
414 | ret = -ENODEV; | 412 | ret = -ENODEV; |
@@ -440,8 +438,7 @@ done: | |||
440 | 438 | ||
441 | static int uvc_v4l2_release(struct inode *inode, struct file *file) | 439 | static int uvc_v4l2_release(struct inode *inode, struct file *file) |
442 | { | 440 | { |
443 | struct video_device *vdev = video_devdata(file); | 441 | struct uvc_video_device *video = video_drvdata(file); |
444 | struct uvc_video_device *video = video_get_drvdata(vdev); | ||
445 | struct uvc_fh *handle = (struct uvc_fh *)file->private_data; | 442 | struct uvc_fh *handle = (struct uvc_fh *)file->private_data; |
446 | 443 | ||
447 | uvc_trace(UVC_TRACE_CALLS, "uvc_v4l2_release\n"); | 444 | uvc_trace(UVC_TRACE_CALLS, "uvc_v4l2_release\n"); |
@@ -1031,8 +1028,7 @@ static struct vm_operations_struct uvc_vm_ops = { | |||
1031 | 1028 | ||
1032 | static int uvc_v4l2_mmap(struct file *file, struct vm_area_struct *vma) | 1029 | static int uvc_v4l2_mmap(struct file *file, struct vm_area_struct *vma) |
1033 | { | 1030 | { |
1034 | struct video_device *vdev = video_devdata(file); | 1031 | struct uvc_video_device *video = video_drvdata(file); |
1035 | struct uvc_video_device *video = video_get_drvdata(vdev); | ||
1036 | struct uvc_buffer *uninitialized_var(buffer); | 1032 | struct uvc_buffer *uninitialized_var(buffer); |
1037 | struct page *page; | 1033 | struct page *page; |
1038 | unsigned long addr, start, size; | 1034 | unsigned long addr, start, size; |
@@ -1085,8 +1081,7 @@ done: | |||
1085 | 1081 | ||
1086 | static unsigned int uvc_v4l2_poll(struct file *file, poll_table *wait) | 1082 | static unsigned int uvc_v4l2_poll(struct file *file, poll_table *wait) |
1087 | { | 1083 | { |
1088 | struct video_device *vdev = video_devdata(file); | 1084 | struct uvc_video_device *video = video_drvdata(file); |
1089 | struct uvc_video_device *video = video_get_drvdata(vdev); | ||
1090 | 1085 | ||
1091 | uvc_trace(UVC_TRACE_CALLS, "uvc_v4l2_poll\n"); | 1086 | uvc_trace(UVC_TRACE_CALLS, "uvc_v4l2_poll\n"); |
1092 | 1087 | ||
diff --git a/drivers/media/video/vino.c b/drivers/media/video/vino.c index ca421cc84f8f..8ec57df1904f 100644 --- a/drivers/media/video/vino.c +++ b/drivers/media/video/vino.c | |||
@@ -4024,8 +4024,7 @@ out: | |||
4024 | 4024 | ||
4025 | static int vino_open(struct inode *inode, struct file *file) | 4025 | static int vino_open(struct inode *inode, struct file *file) |
4026 | { | 4026 | { |
4027 | struct video_device *dev = video_devdata(file); | 4027 | struct vino_channel_settings *vcs = video_drvdata(file); |
4028 | struct vino_channel_settings *vcs = video_get_drvdata(dev); | ||
4029 | int ret = 0; | 4028 | int ret = 0; |
4030 | dprintk("open(): channel = %c\n", | 4029 | dprintk("open(): channel = %c\n", |
4031 | (vcs->channel == VINO_CHANNEL_A) ? 'A' : 'B'); | 4030 | (vcs->channel == VINO_CHANNEL_A) ? 'A' : 'B'); |
@@ -4056,8 +4055,7 @@ static int vino_open(struct inode *inode, struct file *file) | |||
4056 | 4055 | ||
4057 | static int vino_close(struct inode *inode, struct file *file) | 4056 | static int vino_close(struct inode *inode, struct file *file) |
4058 | { | 4057 | { |
4059 | struct video_device *dev = video_devdata(file); | 4058 | struct vino_channel_settings *vcs = video_drvdata(file); |
4060 | struct vino_channel_settings *vcs = video_get_drvdata(dev); | ||
4061 | dprintk("close():\n"); | 4059 | dprintk("close():\n"); |
4062 | 4060 | ||
4063 | mutex_lock(&vcs->mutex); | 4061 | mutex_lock(&vcs->mutex); |
@@ -4100,8 +4098,7 @@ static struct vm_operations_struct vino_vm_ops = { | |||
4100 | 4098 | ||
4101 | static int vino_mmap(struct file *file, struct vm_area_struct *vma) | 4099 | static int vino_mmap(struct file *file, struct vm_area_struct *vma) |
4102 | { | 4100 | { |
4103 | struct video_device *dev = video_devdata(file); | 4101 | struct vino_channel_settings *vcs = video_drvdata(file); |
4104 | struct vino_channel_settings *vcs = video_get_drvdata(dev); | ||
4105 | 4102 | ||
4106 | unsigned long start = vma->vm_start; | 4103 | unsigned long start = vma->vm_start; |
4107 | unsigned long size = vma->vm_end - vma->vm_start; | 4104 | unsigned long size = vma->vm_end - vma->vm_start; |
@@ -4206,8 +4203,7 @@ out: | |||
4206 | 4203 | ||
4207 | static unsigned int vino_poll(struct file *file, poll_table *pt) | 4204 | static unsigned int vino_poll(struct file *file, poll_table *pt) |
4208 | { | 4205 | { |
4209 | struct video_device *dev = video_devdata(file); | 4206 | struct vino_channel_settings *vcs = video_drvdata(file); |
4210 | struct vino_channel_settings *vcs = video_get_drvdata(dev); | ||
4211 | unsigned int outgoing; | 4207 | unsigned int outgoing; |
4212 | unsigned int ret = 0; | 4208 | unsigned int ret = 0; |
4213 | 4209 | ||
@@ -4247,8 +4243,7 @@ error: | |||
4247 | static int vino_do_ioctl(struct inode *inode, struct file *file, | 4243 | static int vino_do_ioctl(struct inode *inode, struct file *file, |
4248 | unsigned int cmd, void *arg) | 4244 | unsigned int cmd, void *arg) |
4249 | { | 4245 | { |
4250 | struct video_device *dev = video_devdata(file); | 4246 | struct vino_channel_settings *vcs = video_drvdata(file); |
4251 | struct vino_channel_settings *vcs = video_get_drvdata(dev); | ||
4252 | 4247 | ||
4253 | #ifdef VINO_DEBUG | 4248 | #ifdef VINO_DEBUG |
4254 | switch (_IOC_TYPE(cmd)) { | 4249 | switch (_IOC_TYPE(cmd)) { |
@@ -4355,8 +4350,7 @@ static int vino_do_ioctl(struct inode *inode, struct file *file, | |||
4355 | static int vino_ioctl(struct inode *inode, struct file *file, | 4350 | static int vino_ioctl(struct inode *inode, struct file *file, |
4356 | unsigned int cmd, unsigned long arg) | 4351 | unsigned int cmd, unsigned long arg) |
4357 | { | 4352 | { |
4358 | struct video_device *dev = video_devdata(file); | 4353 | struct vino_channel_settings *vcs = video_drvdata(file); |
4359 | struct vino_channel_settings *vcs = video_get_drvdata(dev); | ||
4360 | int ret; | 4354 | int ret; |
4361 | 4355 | ||
4362 | if (mutex_lock_interruptible(&vcs->mutex)) | 4356 | if (mutex_lock_interruptible(&vcs->mutex)) |
diff --git a/drivers/media/video/w9966.c b/drivers/media/video/w9966.c index 14ebb15837fb..b2dbe48a92bb 100644 --- a/drivers/media/video/w9966.c +++ b/drivers/media/video/w9966.c | |||
@@ -187,16 +187,14 @@ static ssize_t w9966_v4l_read(struct file *file, char __user *buf, | |||
187 | 187 | ||
188 | static int w9966_exclusive_open(struct inode *inode, struct file *file) | 188 | static int w9966_exclusive_open(struct inode *inode, struct file *file) |
189 | { | 189 | { |
190 | struct video_device *vdev = video_devdata(file); | 190 | struct w9966_dev *cam = video_drvdata(file); |
191 | struct w9966_dev *cam = video_get_drvdata(vdev); | ||
192 | 191 | ||
193 | return test_and_set_bit(0, &cam->in_use) ? -EBUSY : 0; | 192 | return test_and_set_bit(0, &cam->in_use) ? -EBUSY : 0; |
194 | } | 193 | } |
195 | 194 | ||
196 | static int w9966_exclusive_release(struct inode *inode, struct file *file) | 195 | static int w9966_exclusive_release(struct inode *inode, struct file *file) |
197 | { | 196 | { |
198 | struct video_device *vdev = video_devdata(file); | 197 | struct w9966_dev *cam = video_drvdata(file); |
199 | struct w9966_dev *cam = video_get_drvdata(vdev); | ||
200 | 198 | ||
201 | clear_bit(0, &cam->in_use); | 199 | clear_bit(0, &cam->in_use); |
202 | return 0; | 200 | return 0; |
@@ -732,8 +730,7 @@ static int w9966_wReg_i2c(struct w9966_dev* cam, int reg, int data) | |||
732 | static int w9966_v4l_do_ioctl(struct inode *inode, struct file *file, | 730 | static int w9966_v4l_do_ioctl(struct inode *inode, struct file *file, |
733 | unsigned int cmd, void *arg) | 731 | unsigned int cmd, void *arg) |
734 | { | 732 | { |
735 | struct video_device *vdev = video_devdata(file); | 733 | struct w9966_dev *cam = video_drvdata(file); |
736 | struct w9966_dev *cam = video_get_drvdata(vdev); | ||
737 | 734 | ||
738 | switch(cmd) | 735 | switch(cmd) |
739 | { | 736 | { |
@@ -891,8 +888,7 @@ static int w9966_v4l_ioctl(struct inode *inode, struct file *file, | |||
891 | static ssize_t w9966_v4l_read(struct file *file, char __user *buf, | 888 | static ssize_t w9966_v4l_read(struct file *file, char __user *buf, |
892 | size_t count, loff_t *ppos) | 889 | size_t count, loff_t *ppos) |
893 | { | 890 | { |
894 | struct video_device *vdev = video_devdata(file); | 891 | struct w9966_dev *cam = video_drvdata(file); |
895 | struct w9966_dev *cam = video_get_drvdata(vdev); | ||
896 | unsigned char addr = 0xa0; // ECP, read, CCD-transfer, 00000 | 892 | unsigned char addr = 0xa0; // ECP, read, CCD-transfer, 00000 |
897 | unsigned char __user *dest = (unsigned char __user *)buf; | 893 | unsigned char __user *dest = (unsigned char __user *)buf; |
898 | unsigned long dleft = count; | 894 | unsigned long dleft = count; |
diff --git a/drivers/media/video/zc0301/zc0301_core.c b/drivers/media/video/zc0301/zc0301_core.c index 0c3287734c93..6a0902bcba6b 100644 --- a/drivers/media/video/zc0301/zc0301_core.c +++ b/drivers/media/video/zc0301/zc0301_core.c | |||
@@ -657,7 +657,7 @@ static int zc0301_open(struct inode* inode, struct file* filp) | |||
657 | if (!down_read_trylock(&zc0301_dev_lock)) | 657 | if (!down_read_trylock(&zc0301_dev_lock)) |
658 | return -EAGAIN; | 658 | return -EAGAIN; |
659 | 659 | ||
660 | cam = video_get_drvdata(video_devdata(filp)); | 660 | cam = video_drvdata(filp); |
661 | 661 | ||
662 | if (wait_for_completion_interruptible(&cam->probe)) { | 662 | if (wait_for_completion_interruptible(&cam->probe)) { |
663 | up_read(&zc0301_dev_lock); | 663 | up_read(&zc0301_dev_lock); |
@@ -739,7 +739,7 @@ static int zc0301_release(struct inode* inode, struct file* filp) | |||
739 | 739 | ||
740 | down_write(&zc0301_dev_lock); | 740 | down_write(&zc0301_dev_lock); |
741 | 741 | ||
742 | cam = video_get_drvdata(video_devdata(filp)); | 742 | cam = video_drvdata(filp); |
743 | 743 | ||
744 | zc0301_stop_transfer(cam); | 744 | zc0301_stop_transfer(cam); |
745 | zc0301_release_buffers(cam); | 745 | zc0301_release_buffers(cam); |
@@ -759,7 +759,7 @@ static int zc0301_release(struct inode* inode, struct file* filp) | |||
759 | static ssize_t | 759 | static ssize_t |
760 | zc0301_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos) | 760 | zc0301_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos) |
761 | { | 761 | { |
762 | struct zc0301_device* cam = video_get_drvdata(video_devdata(filp)); | 762 | struct zc0301_device *cam = video_drvdata(filp); |
763 | struct zc0301_frame_t* f, * i; | 763 | struct zc0301_frame_t* f, * i; |
764 | unsigned long lock_flags; | 764 | unsigned long lock_flags; |
765 | long timeout; | 765 | long timeout; |
@@ -866,7 +866,7 @@ exit: | |||
866 | 866 | ||
867 | static unsigned int zc0301_poll(struct file *filp, poll_table *wait) | 867 | static unsigned int zc0301_poll(struct file *filp, poll_table *wait) |
868 | { | 868 | { |
869 | struct zc0301_device* cam = video_get_drvdata(video_devdata(filp)); | 869 | struct zc0301_device *cam = video_drvdata(filp); |
870 | struct zc0301_frame_t* f; | 870 | struct zc0301_frame_t* f; |
871 | unsigned long lock_flags; | 871 | unsigned long lock_flags; |
872 | unsigned int mask = 0; | 872 | unsigned int mask = 0; |
@@ -941,7 +941,7 @@ static struct vm_operations_struct zc0301_vm_ops = { | |||
941 | 941 | ||
942 | static int zc0301_mmap(struct file* filp, struct vm_area_struct *vma) | 942 | static int zc0301_mmap(struct file* filp, struct vm_area_struct *vma) |
943 | { | 943 | { |
944 | struct zc0301_device* cam = video_get_drvdata(video_devdata(filp)); | 944 | struct zc0301_device *cam = video_drvdata(filp); |
945 | unsigned long size = vma->vm_end - vma->vm_start, | 945 | unsigned long size = vma->vm_end - vma->vm_start, |
946 | start = vma->vm_start; | 946 | start = vma->vm_start; |
947 | void *pos; | 947 | void *pos; |
@@ -1796,7 +1796,7 @@ zc0301_vidioc_s_parm(struct zc0301_device* cam, void __user * arg) | |||
1796 | static int zc0301_ioctl_v4l2(struct inode* inode, struct file* filp, | 1796 | static int zc0301_ioctl_v4l2(struct inode* inode, struct file* filp, |
1797 | unsigned int cmd, void __user * arg) | 1797 | unsigned int cmd, void __user * arg) |
1798 | { | 1798 | { |
1799 | struct zc0301_device* cam = video_get_drvdata(video_devdata(filp)); | 1799 | struct zc0301_device *cam = video_drvdata(filp); |
1800 | 1800 | ||
1801 | switch (cmd) { | 1801 | switch (cmd) { |
1802 | 1802 | ||
@@ -1891,7 +1891,7 @@ static int zc0301_ioctl_v4l2(struct inode* inode, struct file* filp, | |||
1891 | static int zc0301_ioctl(struct inode* inode, struct file* filp, | 1891 | static int zc0301_ioctl(struct inode* inode, struct file* filp, |
1892 | unsigned int cmd, unsigned long arg) | 1892 | unsigned int cmd, unsigned long arg) |
1893 | { | 1893 | { |
1894 | struct zc0301_device* cam = video_get_drvdata(video_devdata(filp)); | 1894 | struct zc0301_device *cam = video_drvdata(filp); |
1895 | int err = 0; | 1895 | int err = 0; |
1896 | 1896 | ||
1897 | if (mutex_lock_interruptible(&cam->fileop_mutex)) | 1897 | if (mutex_lock_interruptible(&cam->fileop_mutex)) |