aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/arv.c10
-rw-r--r--drivers/media/video/cpia.c12
-rw-r--r--drivers/media/video/pwc/pwc-if.c12
-rw-r--r--drivers/media/video/pwc/pwc-v4l.c2
-rw-r--r--drivers/media/video/s2255drv.c2
-rw-r--r--drivers/media/video/saa5246a.c13
-rw-r--r--drivers/media/video/saa5249.c12
-rw-r--r--drivers/media/video/stk-webcam.c4
-rw-r--r--drivers/media/video/usbvideo/vicam.c9
-rw-r--r--drivers/media/video/w9966.c10
10 files changed, 43 insertions, 43 deletions
diff --git a/drivers/media/video/arv.c b/drivers/media/video/arv.c
index 0d4f9b683459..218754b4906a 100644
--- a/drivers/media/video/arv.c
+++ b/drivers/media/video/arv.c
@@ -270,7 +270,7 @@ static inline void wait_for_vertical_sync(int exp_line)
270static ssize_t ar_read(struct file *file, char *buf, size_t count, loff_t *ppos) 270static ssize_t ar_read(struct file *file, char *buf, size_t count, loff_t *ppos)
271{ 271{
272 struct video_device *v = video_devdata(file); 272 struct video_device *v = video_devdata(file);
273 struct ar_device *ar = v->priv; 273 struct ar_device *ar = video_get_drvdata(v);
274 long ret = ar->frame_bytes; /* return read bytes */ 274 long ret = ar->frame_bytes; /* return read bytes */
275 unsigned long arvcr1 = 0; 275 unsigned long arvcr1 = 0;
276 unsigned long flags; 276 unsigned long flags;
@@ -400,7 +400,7 @@ static int ar_do_ioctl(struct inode *inode, struct file *file,
400 unsigned int cmd, void *arg) 400 unsigned int cmd, void *arg)
401{ 401{
402 struct video_device *dev = video_devdata(file); 402 struct video_device *dev = video_devdata(file);
403 struct ar_device *ar = dev->priv; 403 struct ar_device *ar = video_get_drvdata(dev);
404 404
405 DEBUG(1, "ar_ioctl()\n"); 405 DEBUG(1, "ar_ioctl()\n");
406 switch(cmd) { 406 switch(cmd) {
@@ -626,7 +626,7 @@ static void ar_interrupt(int irq, void *dev)
626 */ 626 */
627static int ar_initialize(struct video_device *dev) 627static int ar_initialize(struct video_device *dev)
628{ 628{
629 struct ar_device *ar = dev->priv; 629 struct ar_device *ar = video_get_drvdata(dev);
630 unsigned long cr = 0; 630 unsigned long cr = 0;
631 int i,found=0; 631 int i,found=0;
632 632
@@ -733,7 +733,7 @@ static int ar_initialize(struct video_device *dev)
733 733
734void ar_release(struct video_device *vfd) 734void ar_release(struct video_device *vfd)
735{ 735{
736 struct ar_device *ar = vfd->priv; 736 struct ar_device *ar = video_get_drvdata(vfd);
737 mutex_lock(&ar->lock); 737 mutex_lock(&ar->lock);
738 video_device_release(vfd); 738 video_device_release(vfd);
739} 739}
@@ -815,7 +815,7 @@ static int __init ar_init(void)
815 return -ENOMEM; 815 return -ENOMEM;
816 } 816 }
817 memcpy(ar->vdev, &ar_template, sizeof(ar_template)); 817 memcpy(ar->vdev, &ar_template, sizeof(ar_template));
818 ar->vdev->priv = ar; 818 video_set_drvdata(ar->vdev, ar);
819 819
820 if (vga) { 820 if (vga) {
821 ar->width = AR_WIDTH_VGA; 821 ar->width = AR_WIDTH_VGA;
diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c
index c0600fdbfc6f..b14c59c281eb 100644
--- a/drivers/media/video/cpia.c
+++ b/drivers/media/video/cpia.c
@@ -3155,7 +3155,7 @@ static void put_cam(struct cpia_camera_ops* ops)
3155static int cpia_open(struct inode *inode, struct file *file) 3155static int cpia_open(struct inode *inode, struct file *file)
3156{ 3156{
3157 struct video_device *dev = video_devdata(file); 3157 struct video_device *dev = video_devdata(file);
3158 struct cam_data *cam = dev->priv; 3158 struct cam_data *cam = video_get_drvdata(dev);
3159 int err; 3159 int err;
3160 3160
3161 if (!cam) { 3161 if (!cam) {
@@ -3232,7 +3232,7 @@ static int cpia_open(struct inode *inode, struct file *file)
3232static int cpia_close(struct inode *inode, struct file *file) 3232static int cpia_close(struct inode *inode, struct file *file)
3233{ 3233{
3234 struct video_device *dev = file->private_data; 3234 struct video_device *dev = file->private_data;
3235 struct cam_data *cam = dev->priv; 3235 struct cam_data *cam = video_get_drvdata(dev);
3236 3236
3237 if (cam->ops) { 3237 if (cam->ops) {
3238 /* Return ownership of /proc/cpia/videoX to root */ 3238 /* Return ownership of /proc/cpia/videoX to root */
@@ -3284,7 +3284,7 @@ static ssize_t cpia_read(struct file *file, char __user *buf,
3284 size_t count, loff_t *ppos) 3284 size_t count, loff_t *ppos)
3285{ 3285{
3286 struct video_device *dev = file->private_data; 3286 struct video_device *dev = file->private_data;
3287 struct cam_data *cam = dev->priv; 3287 struct cam_data *cam = video_get_drvdata(dev);
3288 int err; 3288 int err;
3289 3289
3290 /* make this _really_ smp and multithread-safe */ 3290 /* make this _really_ smp and multithread-safe */
@@ -3341,7 +3341,7 @@ static int cpia_do_ioctl(struct inode *inode, struct file *file,
3341 unsigned int ioctlnr, void *arg) 3341 unsigned int ioctlnr, void *arg)
3342{ 3342{
3343 struct video_device *dev = file->private_data; 3343 struct video_device *dev = file->private_data;
3344 struct cam_data *cam = dev->priv; 3344 struct cam_data *cam = video_get_drvdata(dev);
3345 int retval = 0; 3345 int retval = 0;
3346 3346
3347 if (!cam || !cam->ops) 3347 if (!cam || !cam->ops)
@@ -3739,7 +3739,7 @@ static int cpia_mmap(struct file *file, struct vm_area_struct *vma)
3739 unsigned long start = vma->vm_start; 3739 unsigned long start = vma->vm_start;
3740 unsigned long size = vma->vm_end - vma->vm_start; 3740 unsigned long size = vma->vm_end - vma->vm_start;
3741 unsigned long page, pos; 3741 unsigned long page, pos;
3742 struct cam_data *cam = dev->priv; 3742 struct cam_data *cam = video_get_drvdata(dev);
3743 int retval; 3743 int retval;
3744 3744
3745 if (!cam || !cam->ops) 3745 if (!cam || !cam->ops)
@@ -3929,7 +3929,7 @@ static void init_camera_struct(struct cam_data *cam,
3929 cam->proc_entry = NULL; 3929 cam->proc_entry = NULL;
3930 3930
3931 memcpy(&cam->vdev, &cpia_template, sizeof(cpia_template)); 3931 memcpy(&cam->vdev, &cpia_template, sizeof(cpia_template));
3932 cam->vdev.priv = cam; 3932 video_set_drvdata(&cam->vdev, cam);
3933 3933
3934 cam->curframe = 0; 3934 cam->curframe = 0;
3935 for (i = 0; i < FRAME_NUM; i++) { 3935 for (i = 0; i < FRAME_NUM; i++) {
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c
index 9aee7cb6f79a..ab28389b4cda 100644
--- a/drivers/media/video/pwc/pwc-if.c
+++ b/drivers/media/video/pwc/pwc-if.c
@@ -1112,7 +1112,7 @@ static int pwc_video_open(struct inode *inode, struct file *file)
1112 1112
1113 PWC_DEBUG_OPEN(">> video_open called(vdev = 0x%p).\n", vdev); 1113 PWC_DEBUG_OPEN(">> video_open called(vdev = 0x%p).\n", vdev);
1114 1114
1115 pdev = (struct pwc_device *)vdev->priv; 1115 pdev = video_get_drvdata(vdev);
1116 BUG_ON(!pdev); 1116 BUG_ON(!pdev);
1117 if (pdev->vopen) { 1117 if (pdev->vopen) {
1118 PWC_DEBUG_OPEN("I'm busy, someone is using the device.\n"); 1118 PWC_DEBUG_OPEN("I'm busy, someone is using the device.\n");
@@ -1233,7 +1233,7 @@ static int pwc_video_close(struct inode *inode, struct file *file)
1233 PWC_DEBUG_OPEN(">> video_close called(vdev = 0x%p).\n", vdev); 1233 PWC_DEBUG_OPEN(">> video_close called(vdev = 0x%p).\n", vdev);
1234 1234
1235 lock_kernel(); 1235 lock_kernel();
1236 pdev = (struct pwc_device *)vdev->priv; 1236 pdev = video_get_drvdata(vdev);
1237 if (pdev->vopen == 0) 1237 if (pdev->vopen == 0)
1238 PWC_DEBUG_MODULE("video_close() called on closed device?\n"); 1238 PWC_DEBUG_MODULE("video_close() called on closed device?\n");
1239 1239
@@ -1304,7 +1304,7 @@ static ssize_t pwc_video_read(struct file *file, char __user *buf,
1304 vdev, buf, count); 1304 vdev, buf, count);
1305 if (vdev == NULL) 1305 if (vdev == NULL)
1306 return -EFAULT; 1306 return -EFAULT;
1307 pdev = vdev->priv; 1307 pdev = video_get_drvdata(vdev);
1308 if (pdev == NULL) 1308 if (pdev == NULL)
1309 return -EFAULT; 1309 return -EFAULT;
1310 1310
@@ -1386,7 +1386,7 @@ static unsigned int pwc_video_poll(struct file *file, poll_table *wait)
1386 1386
1387 if (vdev == NULL) 1387 if (vdev == NULL)
1388 return -EFAULT; 1388 return -EFAULT;
1389 pdev = vdev->priv; 1389 pdev = video_get_drvdata(vdev);
1390 if (pdev == NULL) 1390 if (pdev == NULL)
1391 return -EFAULT; 1391 return -EFAULT;
1392 1392
@@ -1408,7 +1408,7 @@ static int pwc_video_ioctl(struct inode *inode, struct file *file,
1408 1408
1409 if (!vdev) 1409 if (!vdev)
1410 goto out; 1410 goto out;
1411 pdev = vdev->priv; 1411 pdev = video_get_drvdata(vdev);
1412 1412
1413 mutex_lock(&pdev->modlock); 1413 mutex_lock(&pdev->modlock);
1414 if (!pdev->unplugged) 1414 if (!pdev->unplugged)
@@ -1428,7 +1428,7 @@ static int pwc_video_mmap(struct file *file, struct vm_area_struct *vma)
1428 int index; 1428 int index;
1429 1429
1430 PWC_DEBUG_MEMORY(">> %s\n", __func__); 1430 PWC_DEBUG_MEMORY(">> %s\n", __func__);
1431 pdev = vdev->priv; 1431 pdev = video_get_drvdata(vdev);
1432 size = vma->vm_end - vma->vm_start; 1432 size = vma->vm_end - vma->vm_start;
1433 start = vma->vm_start; 1433 start = vma->vm_start;
1434 1434
diff --git a/drivers/media/video/pwc/pwc-v4l.c b/drivers/media/video/pwc/pwc-v4l.c
index 1742889874df..76a1376c9751 100644
--- a/drivers/media/video/pwc/pwc-v4l.c
+++ b/drivers/media/video/pwc/pwc-v4l.c
@@ -346,7 +346,7 @@ int pwc_video_do_ioctl(struct inode *inode, struct file *file,
346 346
347 if (vdev == NULL) 347 if (vdev == NULL)
348 return -EFAULT; 348 return -EFAULT;
349 pdev = vdev->priv; 349 pdev = video_get_drvdata(vdev);
350 if (pdev == NULL) 350 if (pdev == NULL)
351 return -EFAULT; 351 return -EFAULT;
352 352
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c
index af19bb346ef1..ea40f4c8b33e 100644
--- a/drivers/media/video/s2255drv.c
+++ b/drivers/media/video/s2255drv.c
@@ -1800,7 +1800,7 @@ static int s2255_probe_v4l(struct s2255_dev *dev)
1800 ret = video_register_device(dev->vdev[i], 1800 ret = video_register_device(dev->vdev[i],
1801 VFL_TYPE_GRABBER, 1801 VFL_TYPE_GRABBER,
1802 cur_nr + i); 1802 cur_nr + i);
1803 dev->vdev[i]->priv = dev; 1803 video_set_drvdata(dev->vdev[i], dev);
1804 1804
1805 if (ret != 0) { 1805 if (ret != 0) {
1806 dev_err(&dev->udev->dev, 1806 dev_err(&dev->udev->dev,
diff --git a/drivers/media/video/saa5246a.c b/drivers/media/video/saa5246a.c
index 5f5aa2063e0e..0178b49da0c1 100644
--- a/drivers/media/video/saa5246a.c
+++ b/drivers/media/video/saa5246a.c
@@ -117,7 +117,7 @@ static int saa5246a_attach(struct i2c_adapter *adap, int addr, int kind)
117 memset(t->pgbuf[pgbuf], ' ', sizeof(t->pgbuf[0])); 117 memset(t->pgbuf[pgbuf], ' ', sizeof(t->pgbuf[0]));
118 t->is_searching[pgbuf] = false; 118 t->is_searching[pgbuf] = false;
119 } 119 }
120 vd->priv=t; 120 video_set_drvdata(vd, t);
121 121
122 122
123 /* 123 /*
@@ -151,7 +151,7 @@ static int saa5246a_detach(struct i2c_client *client)
151 struct video_device *vd = i2c_get_clientdata(client); 151 struct video_device *vd = i2c_get_clientdata(client);
152 i2c_detach_client(client); 152 i2c_detach_client(client);
153 video_unregister_device(vd); 153 video_unregister_device(vd);
154 kfree(vd->priv); 154 kfree(video_get_drvdata(vd));
155 kfree(client); 155 kfree(client);
156 return 0; 156 return 0;
157} 157}
@@ -582,7 +582,8 @@ static int do_saa5246a_ioctl(struct inode *inode, struct file *file,
582 unsigned int cmd, void *arg) 582 unsigned int cmd, void *arg)
583{ 583{
584 struct video_device *vd = video_devdata(file); 584 struct video_device *vd = video_devdata(file);
585 struct saa5246a_device *t=vd->priv; 585 struct saa5246a_device *t = video_get_drvdata(vd);
586
586 switch(cmd) 587 switch(cmd)
587 { 588 {
588 case VTXIOCGETINFO: 589 case VTXIOCGETINFO:
@@ -723,7 +724,7 @@ static int saa5246a_ioctl(struct inode *inode, struct file *file,
723 unsigned int cmd, unsigned long arg) 724 unsigned int cmd, unsigned long arg)
724{ 725{
725 struct video_device *vd = video_devdata(file); 726 struct video_device *vd = video_devdata(file);
726 struct saa5246a_device *t = vd->priv; 727 struct saa5246a_device *t = video_get_drvdata(vd);
727 int err; 728 int err;
728 729
729 cmd = vtx_fix_command(cmd); 730 cmd = vtx_fix_command(cmd);
@@ -736,7 +737,7 @@ static int saa5246a_ioctl(struct inode *inode, struct file *file,
736static int saa5246a_open(struct inode *inode, struct file *file) 737static int saa5246a_open(struct inode *inode, struct file *file)
737{ 738{
738 struct video_device *vd = video_devdata(file); 739 struct video_device *vd = video_devdata(file);
739 struct saa5246a_device *t = vd->priv; 740 struct saa5246a_device *t = video_get_drvdata(vd);
740 741
741 if (t->client == NULL) 742 if (t->client == NULL)
742 return -ENODEV; 743 return -ENODEV;
@@ -779,7 +780,7 @@ static int saa5246a_open(struct inode *inode, struct file *file)
779static int saa5246a_release(struct inode *inode, struct file *file) 780static int saa5246a_release(struct inode *inode, struct file *file)
780{ 781{
781 struct video_device *vd = video_devdata(file); 782 struct video_device *vd = video_devdata(file);
782 struct saa5246a_device *t = vd->priv; 783 struct saa5246a_device *t = video_get_drvdata(vd);
783 784
784 /* Stop all acquisition circuits. */ 785 /* Stop all acquisition circuits. */
785 i2c_senddata(t, SAA5246A_REGISTER_R1, 786 i2c_senddata(t, SAA5246A_REGISTER_R1,
diff --git a/drivers/media/video/saa5249.c b/drivers/media/video/saa5249.c
index 225117c789ca..c784715a0b04 100644
--- a/drivers/media/video/saa5249.c
+++ b/drivers/media/video/saa5249.c
@@ -186,7 +186,7 @@ static int saa5249_attach(struct i2c_adapter *adap, int addr, int kind)
186 t->vdau[pgbuf].stopped = true; 186 t->vdau[pgbuf].stopped = true;
187 t->is_searching[pgbuf] = false; 187 t->is_searching[pgbuf] = false;
188 } 188 }
189 vd->priv=t; 189 video_set_drvdata(vd, t);
190 190
191 191
192 /* 192 /*
@@ -221,7 +221,7 @@ static int saa5249_detach(struct i2c_client *client)
221 struct video_device *vd = i2c_get_clientdata(client); 221 struct video_device *vd = i2c_get_clientdata(client);
222 i2c_detach_client(client); 222 i2c_detach_client(client);
223 video_unregister_device(vd); 223 video_unregister_device(vd);
224 kfree(vd->priv); 224 kfree(video_get_drvdata(vd));
225 kfree(vd); 225 kfree(vd);
226 kfree(client); 226 kfree(client);
227 return 0; 227 return 0;
@@ -320,7 +320,7 @@ static int do_saa5249_ioctl(struct inode *inode, struct file *file,
320{ 320{
321 static int virtual_mode = false; 321 static int virtual_mode = false;
322 struct video_device *vd = video_devdata(file); 322 struct video_device *vd = video_devdata(file);
323 struct saa5249_device *t=vd->priv; 323 struct saa5249_device *t = video_get_drvdata(vd);
324 324
325 switch(cmd) 325 switch(cmd)
326 { 326 {
@@ -619,7 +619,7 @@ static int saa5249_ioctl(struct inode *inode, struct file *file,
619 unsigned int cmd, unsigned long arg) 619 unsigned int cmd, unsigned long arg)
620{ 620{
621 struct video_device *vd = video_devdata(file); 621 struct video_device *vd = video_devdata(file);
622 struct saa5249_device *t=vd->priv; 622 struct saa5249_device *t = video_get_drvdata(vd);
623 int err; 623 int err;
624 624
625 cmd = vtx_fix_command(cmd); 625 cmd = vtx_fix_command(cmd);
@@ -632,7 +632,7 @@ static int saa5249_ioctl(struct inode *inode, struct file *file,
632static int saa5249_open(struct inode *inode, struct file *file) 632static int saa5249_open(struct inode *inode, struct file *file)
633{ 633{
634 struct video_device *vd = video_devdata(file); 634 struct video_device *vd = video_devdata(file);
635 struct saa5249_device *t = vd->priv; 635 struct saa5249_device *t = video_get_drvdata(vd);
636 int pgbuf; 636 int pgbuf;
637 637
638 if (t->client == NULL) 638 if (t->client == NULL)
@@ -670,7 +670,7 @@ static int saa5249_open(struct inode *inode, struct file *file)
670static int saa5249_release(struct inode *inode, struct file *file) 670static int saa5249_release(struct inode *inode, struct file *file)
671{ 671{
672 struct video_device *vd = video_devdata(file); 672 struct video_device *vd = video_devdata(file);
673 struct saa5249_device *t = vd->priv; 673 struct saa5249_device *t = video_get_drvdata(vd);
674 674
675 i2c_senddata(t, 1, 0x20, -1); /* Turn off CCT */ 675 i2c_senddata(t, 1, 0x20, -1); /* Turn off CCT */
676 i2c_senddata(t, 5, 3, 3, -1); /* Turn off TV-display */ 676 i2c_senddata(t, 5, 3, 3, -1); /* Turn off TV-display */
diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c
index 6b1ef5dc562c..8dda5680094d 100644
--- a/drivers/media/video/stk-webcam.c
+++ b/drivers/media/video/stk-webcam.c
@@ -72,7 +72,7 @@ static void stk_camera_cleanup(struct kref *kref)
72 STK_INFO("Syntek USB2.0 Camera release resources" 72 STK_INFO("Syntek USB2.0 Camera release resources"
73 " video device /dev/video%d\n", dev->vdev.minor); 73 " video device /dev/video%d\n", dev->vdev.minor);
74 video_unregister_device(&dev->vdev); 74 video_unregister_device(&dev->vdev);
75 dev->vdev.priv = NULL; 75 video_set_drvdata(&dev->vdev, NULL);
76 76
77 if (dev->sio_bufs != NULL || dev->isobufs != NULL) 77 if (dev->sio_bufs != NULL || dev->isobufs != NULL)
78 STK_ERROR("We are leaking memory\n"); 78 STK_ERROR("We are leaking memory\n");
@@ -1379,7 +1379,7 @@ static int stk_register_video_device(struct stk_camera *dev)
1379 dev->vdev = stk_v4l_data; 1379 dev->vdev = stk_v4l_data;
1380 dev->vdev.debug = debug; 1380 dev->vdev.debug = debug;
1381 dev->vdev.parent = &dev->interface->dev; 1381 dev->vdev.parent = &dev->interface->dev;
1382 dev->vdev.priv = dev; 1382 video_set_drvdata(&dev->vdev, dev);
1383 err = video_register_device(&dev->vdev, VFL_TYPE_GRABBER, -1); 1383 err = video_register_device(&dev->vdev, VFL_TYPE_GRABBER, -1);
1384 if (err) 1384 if (err)
1385 STK_ERROR("v4l registration failed\n"); 1385 STK_ERROR("v4l registration failed\n");
diff --git a/drivers/media/video/usbvideo/vicam.c b/drivers/media/video/usbvideo/vicam.c
index d7728256f295..1ffcc393fcbb 100644
--- a/drivers/media/video/usbvideo/vicam.c
+++ b/drivers/media/video/usbvideo/vicam.c
@@ -473,8 +473,8 @@ static int
473vicam_open(struct inode *inode, struct file *file) 473vicam_open(struct inode *inode, struct file *file)
474{ 474{
475 struct video_device *dev = video_devdata(file); 475 struct video_device *dev = video_devdata(file);
476 struct vicam_camera *cam = 476 struct vicam_camera *cam = video_get_drvdata(dev);
477 (struct vicam_camera *) dev->priv; 477
478 DBG("open\n"); 478 DBG("open\n");
479 479
480 if (!cam) { 480 if (!cam) {
@@ -866,9 +866,8 @@ vicam_probe( struct usb_interface *intf, const struct usb_device_id *id)
866 866
867 mutex_init(&cam->cam_lock); 867 mutex_init(&cam->cam_lock);
868 868
869 memcpy(&cam->vdev, &vicam_template, 869 memcpy(&cam->vdev, &vicam_template, sizeof(vicam_template));
870 sizeof (vicam_template)); 870 video_set_drvdata(&cam->vdev, cam);
871 cam->vdev.priv = cam; // sort of a reverse mapping for those functions that get vdev only
872 871
873 cam->udev = dev; 872 cam->udev = dev;
874 cam->bulkEndpoint = bulkEndpoint; 873 cam->bulkEndpoint = bulkEndpoint;
diff --git a/drivers/media/video/w9966.c b/drivers/media/video/w9966.c
index e3580119640f..14ebb15837fb 100644
--- a/drivers/media/video/w9966.c
+++ b/drivers/media/video/w9966.c
@@ -188,7 +188,7 @@ static ssize_t w9966_v4l_read(struct file *file, char __user *buf,
188static int w9966_exclusive_open(struct inode *inode, struct file *file) 188static int w9966_exclusive_open(struct inode *inode, struct file *file)
189{ 189{
190 struct video_device *vdev = video_devdata(file); 190 struct video_device *vdev = video_devdata(file);
191 struct w9966_dev *cam = vdev->priv; 191 struct w9966_dev *cam = video_get_drvdata(vdev);
192 192
193 return test_and_set_bit(0, &cam->in_use) ? -EBUSY : 0; 193 return test_and_set_bit(0, &cam->in_use) ? -EBUSY : 0;
194} 194}
@@ -196,7 +196,7 @@ static int w9966_exclusive_open(struct inode *inode, struct file *file)
196static int w9966_exclusive_release(struct inode *inode, struct file *file) 196static int w9966_exclusive_release(struct inode *inode, struct file *file)
197{ 197{
198 struct video_device *vdev = video_devdata(file); 198 struct video_device *vdev = video_devdata(file);
199 struct w9966_dev *cam = vdev->priv; 199 struct w9966_dev *cam = video_get_drvdata(vdev);
200 200
201 clear_bit(0, &cam->in_use); 201 clear_bit(0, &cam->in_use);
202 return 0; 202 return 0;
@@ -351,7 +351,7 @@ static int w9966_init(struct w9966_dev* cam, struct parport* port)
351 351
352// Fill in the video_device struct and register us to v4l 352// Fill in the video_device struct and register us to v4l
353 memcpy(&cam->vdev, &w9966_template, sizeof(struct video_device)); 353 memcpy(&cam->vdev, &w9966_template, sizeof(struct video_device));
354 cam->vdev.priv = cam; 354 video_set_drvdata(&cam->vdev, cam);
355 355
356 if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, video_nr) < 0) 356 if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, video_nr) < 0)
357 return -1; 357 return -1;
@@ -733,7 +733,7 @@ static int w9966_v4l_do_ioctl(struct inode *inode, struct file *file,
733 unsigned int cmd, void *arg) 733 unsigned int cmd, void *arg)
734{ 734{
735 struct video_device *vdev = video_devdata(file); 735 struct video_device *vdev = video_devdata(file);
736 struct w9966_dev *cam = vdev->priv; 736 struct w9966_dev *cam = video_get_drvdata(vdev);
737 737
738 switch(cmd) 738 switch(cmd)
739 { 739 {
@@ -892,7 +892,7 @@ static ssize_t w9966_v4l_read(struct file *file, char __user *buf,
892 size_t count, loff_t *ppos) 892 size_t count, loff_t *ppos)
893{ 893{
894 struct video_device *vdev = video_devdata(file); 894 struct video_device *vdev = video_devdata(file);
895 struct w9966_dev *cam = vdev->priv; 895 struct w9966_dev *cam = video_get_drvdata(vdev);
896 unsigned char addr = 0xa0; // ECP, read, CCD-transfer, 00000 896 unsigned char addr = 0xa0; // ECP, read, CCD-transfer, 00000
897 unsigned char __user *dest = (unsigned char __user *)buf; 897 unsigned char __user *dest = (unsigned char __user *)buf;
898 unsigned long dleft = count; 898 unsigned long dleft = count;