]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/w9966.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6-omap-h63xx.git] / drivers / media / video / w9966.c
index c635cffb1fb810088d0c093b72e8a926cd0432e9..b2dbe48a92bbd72360b1fec3dea0e59806dc671f 100644 (file)
@@ -187,16 +187,14 @@ static ssize_t w9966_v4l_read(struct file *file, char __user *buf,
 
 static int w9966_exclusive_open(struct inode *inode, struct file *file)
 {
-       struct video_device *vdev = video_devdata(file);
-       struct w9966_dev *cam = vdev->priv;
+       struct w9966_dev *cam = video_drvdata(file);
 
        return test_and_set_bit(0, &cam->in_use) ? -EBUSY : 0;
 }
 
 static int w9966_exclusive_release(struct inode *inode, struct file *file)
 {
-       struct video_device *vdev = video_devdata(file);
-       struct w9966_dev *cam = vdev->priv;
+       struct w9966_dev *cam = video_drvdata(file);
 
        clear_bit(0, &cam->in_use);
        return 0;
@@ -216,6 +214,7 @@ static const struct file_operations w9966_fops = {
 static struct video_device w9966_template = {
        .name           = W9966_DRIVERNAME,
        .fops           = &w9966_fops,
+       .release        = video_device_release_empty,
 };
 
 /*
@@ -350,7 +349,7 @@ static int w9966_init(struct w9966_dev* cam, struct parport* port)
 
 // Fill in the video_device struct and register us to v4l
        memcpy(&cam->vdev, &w9966_template, sizeof(struct video_device));
-       cam->vdev.priv = cam;
+       video_set_drvdata(&cam->vdev, cam);
 
        if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, video_nr) < 0)
                return -1;
@@ -731,8 +730,7 @@ static int w9966_wReg_i2c(struct w9966_dev* cam, int reg, int data)
 static int w9966_v4l_do_ioctl(struct inode *inode, struct file *file,
                              unsigned int cmd, void *arg)
 {
-       struct video_device *vdev = video_devdata(file);
-       struct w9966_dev *cam = vdev->priv;
+       struct w9966_dev *cam = video_drvdata(file);
 
        switch(cmd)
        {
@@ -890,8 +888,7 @@ static int w9966_v4l_ioctl(struct inode *inode, struct file *file,
 static ssize_t w9966_v4l_read(struct file *file, char  __user *buf,
                              size_t count, loff_t *ppos)
 {
-       struct video_device *vdev = video_devdata(file);
-       struct w9966_dev *cam = vdev->priv;
+       struct w9966_dev *cam = video_drvdata(file);
        unsigned char addr = 0xa0;      // ECP, read, CCD-transfer, 00000
        unsigned char __user *dest = (unsigned char __user *)buf;
        unsigned long dleft = count;