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>
 static int vidioc_g_tuner(struct file *file, void *priv,
                                struct v4l2_tuner *v)
 {
-       struct dsbr100_device *radio = video_get_drvdata(video_devdata(file));
+       struct dsbr100_device *radio = video_drvdata(file);
 
        if (v->index > 0)
                return -EINVAL;
 static int vidioc_s_frequency(struct file *file, void *priv,
                                struct v4l2_frequency *f)
 {
-       struct dsbr100_device *radio = video_get_drvdata(video_devdata(file));
+       struct dsbr100_device *radio = video_drvdata(file);
 
        radio->curfreq = f->frequency;
        if (dsbr100_setfreq(radio, radio->curfreq)==-1)
 static int vidioc_g_frequency(struct file *file, void *priv,
                                struct v4l2_frequency *f)
 {
-       struct dsbr100_device *radio = video_get_drvdata(video_devdata(file));
+       struct dsbr100_device *radio = video_drvdata(file);
 
        f->type = V4L2_TUNER_RADIO;
        f->frequency = radio->curfreq;
 static int vidioc_g_ctrl(struct file *file, void *priv,
                                struct v4l2_control *ctrl)
 {
-       struct dsbr100_device *radio = video_get_drvdata(video_devdata(file));
+       struct dsbr100_device *radio = video_drvdata(file);
 
        switch (ctrl->id) {
        case V4L2_CID_AUDIO_MUTE:
 static int vidioc_s_ctrl(struct file *file, void *priv,
                                struct v4l2_control *ctrl)
 {
-       struct dsbr100_device *radio = video_get_drvdata(video_devdata(file));
+       struct dsbr100_device *radio = video_drvdata(file);
 
        switch (ctrl->id) {
        case V4L2_CID_AUDIO_MUTE:
 
 static int usb_dsbr100_open(struct inode *inode, struct file *file)
 {
-       struct dsbr100_device *radio=video_get_drvdata(video_devdata(file));
+       struct dsbr100_device *radio = video_drvdata(file);
 
        lock_kernel();
        radio->users = 1;
 
 static int usb_dsbr100_close(struct inode *inode, struct file *file)
 {
-       struct dsbr100_device *radio=video_get_drvdata(video_devdata(file));
+       struct dsbr100_device *radio = video_drvdata(file);
 
        if (!radio)
                return -ENODEV;
 
 static int vidioc_g_tuner(struct file *file, void *priv,
                                        struct v4l2_tuner *v)
 {
-       struct video_device *dev = video_devdata(file);
-       struct rt_device *rt = video_get_drvdata(dev);
+       struct rt_device *rt = video_drvdata(file);
 
        if (v->index > 0)
                return -EINVAL;
 static int vidioc_s_frequency(struct file *file, void *priv,
                                        struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct rt_device *rt = video_get_drvdata(dev);
+       struct rt_device *rt = video_drvdata(file);
 
        rt->curfreq = f->frequency;
        rt_setfreq(rt, rt->curfreq);
 static int vidioc_g_frequency(struct file *file, void *priv,
                                        struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct rt_device *rt = video_get_drvdata(dev);
+       struct rt_device *rt = video_drvdata(file);
 
        f->type = V4L2_TUNER_RADIO;
        f->frequency = rt->curfreq;
 static int vidioc_g_ctrl(struct file *file, void *priv,
                                        struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct rt_device *rt = video_get_drvdata(dev);
+       struct rt_device *rt = video_drvdata(file);
 
        switch (ctrl->id) {
        case V4L2_CID_AUDIO_MUTE:
 static int vidioc_s_ctrl(struct file *file, void *priv,
                                        struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct rt_device *rt = video_get_drvdata(dev);
+       struct rt_device *rt = video_drvdata(file);
 
        switch (ctrl->id) {
        case V4L2_CID_AUDIO_MUTE:
 
 static int vidioc_g_tuner (struct file *file, void *priv,
                                struct v4l2_tuner *v)
 {
-       struct video_device *dev = video_devdata(file);
-       struct az_device *az = video_get_drvdata(dev);
+       struct az_device *az = video_drvdata(file);
 
        if (v->index > 0)
                return -EINVAL;
 static int vidioc_s_frequency (struct file *file, void *priv,
                                struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct az_device *az = video_get_drvdata(dev);
+       struct az_device *az = video_drvdata(file);
 
        az->curfreq = f->frequency;
        az_setfreq(az, az->curfreq);
 static int vidioc_g_frequency (struct file *file, void *priv,
                                struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct az_device *az = video_get_drvdata(dev);
+       struct az_device *az = video_drvdata(file);
 
        f->type = V4L2_TUNER_RADIO;
        f->frequency = az->curfreq;
 static int vidioc_g_ctrl (struct file *file, void *priv,
                            struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct az_device *az = video_get_drvdata(dev);
+       struct az_device *az = video_drvdata(file);
 
        switch (ctrl->id) {
                case V4L2_CID_AUDIO_MUTE:
 static int vidioc_s_ctrl (struct file *file, void *priv,
                            struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct az_device *az = video_get_drvdata(dev);
+       struct az_device *az = video_drvdata(file);
 
        switch (ctrl->id) {
                case V4L2_CID_AUDIO_MUTE:
 
 static int vidioc_g_tuner(struct file *file, void *priv,
                                        struct v4l2_tuner *v)
 {
-       struct video_device *dev = video_devdata(file);
-       struct gemtek_pci_card *card = video_get_drvdata(dev);
+       struct gemtek_pci_card *card = video_drvdata(file);
 
        if (v->index > 0)
                return -EINVAL;
 static int vidioc_s_frequency(struct file *file, void *priv,
                                        struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct gemtek_pci_card *card = video_get_drvdata(dev);
+       struct gemtek_pci_card *card = video_drvdata(file);
 
        if ( (f->frequency < GEMTEK_PCI_RANGE_LOW) ||
                        (f->frequency > GEMTEK_PCI_RANGE_HIGH) )
 static int vidioc_g_frequency(struct file *file, void *priv,
                                        struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct gemtek_pci_card *card = video_get_drvdata(dev);
+       struct gemtek_pci_card *card = video_drvdata(file);
 
        f->type = V4L2_TUNER_RADIO;
        f->frequency = card->current_frequency;
 static int vidioc_g_ctrl(struct file *file, void *priv,
                                        struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct gemtek_pci_card *card = video_get_drvdata(dev);
+       struct gemtek_pci_card *card = video_drvdata(file);
 
        switch (ctrl->id) {
        case V4L2_CID_AUDIO_MUTE:
 static int vidioc_s_ctrl(struct file *file, void *priv,
                                        struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct gemtek_pci_card *card = video_get_drvdata(dev);
+       struct gemtek_pci_card *card = video_drvdata(file);
 
        switch (ctrl->id) {
        case V4L2_CID_AUDIO_MUTE:
 
 static int vidioc_s_frequency(struct file *file, void *priv,
                              struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct gemtek_device *rt = video_get_drvdata(dev);
+       struct gemtek_device *rt = video_drvdata(file);
 
        gemtek_setfreq(rt, f->frequency);
 
 static int vidioc_g_frequency(struct file *file, void *priv,
                              struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct gemtek_device *rt = video_get_drvdata(dev);
+       struct gemtek_device *rt = video_drvdata(file);
 
        f->type = V4L2_TUNER_RADIO;
        f->frequency = rt->lastfreq;
 static int vidioc_g_ctrl(struct file *file, void *priv,
                         struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct gemtek_device *rt = video_get_drvdata(dev);
+       struct gemtek_device *rt = video_drvdata(file);
 
        switch (ctrl->id) {
        case V4L2_CID_AUDIO_MUTE:
 static int vidioc_s_ctrl(struct file *file, void *priv,
                         struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct gemtek_device *rt = video_get_drvdata(dev);
+       struct gemtek_device *rt = video_drvdata(file);
 
        switch (ctrl->id) {
        case V4L2_CID_AUDIO_MUTE:
 
 static int vidioc_g_tuner(struct file *file, void *priv,
                                        struct v4l2_tuner *v)
 {
-       struct video_device *dev = video_devdata(file);
-       struct radio_device *card = video_get_drvdata(dev);
+       struct radio_device *card = video_drvdata(file);
 
        if (v->index > 0)
                return -EINVAL;
 static int vidioc_s_frequency(struct file *file, void *priv,
                                        struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct radio_device *card = video_get_drvdata(dev);
+       struct radio_device *card = video_drvdata(file);
 
        if (f->frequency < FREQ_LO || f->frequency > FREQ_HI)
                return -EINVAL;
 static int vidioc_g_frequency(struct file *file, void *priv,
                                        struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct radio_device *card = video_get_drvdata(dev);
+       struct radio_device *card = video_drvdata(file);
 
        f->type = V4L2_TUNER_RADIO;
        f->frequency = BITS2FREQ(radio_bits_get(card));
 static int vidioc_g_ctrl(struct file *file, void *priv,
                                        struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct radio_device *card = video_get_drvdata(dev);
+       struct radio_device *card = video_drvdata(file);
 
        switch (ctrl->id) {
        case V4L2_CID_AUDIO_MUTE:
 static int vidioc_s_ctrl(struct file *file, void *priv,
                                        struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct radio_device *card = video_get_drvdata(dev);
+       struct radio_device *card = video_drvdata(file);
        register u16 io = card->io;
        register u16 omask = inw(io + IO_MASK);
 
 
 static int vidioc_g_tuner (struct file *file, void *priv,
                           struct v4l2_tuner *v)
 {
-       struct video_device *dev = video_devdata(file);
-       struct radio_device *card = video_get_drvdata(dev);
+       struct radio_device *card = video_drvdata(file);
 
        if (v->index > 0)
                return -EINVAL;
 static int vidioc_s_frequency (struct file *file, void *priv,
                               struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct radio_device *card = video_get_drvdata(dev);
+       struct radio_device *card = video_drvdata(file);
 
        if (f->frequency < FREQ_LO || f->frequency > FREQ_HI) {
                dprintk(1, "radio freq (%d.%02d MHz) out of range (%d-%d)\n",
 static int vidioc_g_frequency (struct file *file, void *priv,
                               struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct radio_device *card = video_get_drvdata(dev);
+       struct radio_device *card = video_drvdata(file);
 
        f->type = V4L2_TUNER_RADIO;
        f->frequency = card->freq;
 static int vidioc_g_ctrl (struct file *file, void *priv,
                            struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct radio_device *card = video_get_drvdata(dev);
+       struct radio_device *card = video_drvdata(file);
 
        switch (ctrl->id) {
                case V4L2_CID_AUDIO_MUTE:
 static int vidioc_s_ctrl (struct file *file, void *priv,
                          struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct radio_device *card = video_get_drvdata(dev);
+       struct radio_device *card = video_drvdata(file);
 
        switch (ctrl->id) {
                case V4L2_CID_AUDIO_MUTE:
 
 static int vidioc_g_tuner(struct file *file, void *priv,
                                struct v4l2_tuner *v)
 {
-       struct video_device *dev = video_devdata(file);
-       struct rt_device *rt = video_get_drvdata(dev);
+       struct rt_device *rt = video_drvdata(file);
 
        if (v->index > 0)
                return -EINVAL;
 static int vidioc_s_frequency(struct file *file, void *priv,
                                struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct rt_device *rt = video_get_drvdata(dev);
+       struct rt_device *rt = video_drvdata(file);
 
        rt->curfreq = f->frequency;
        rt_setfreq(rt, rt->curfreq);
 static int vidioc_g_frequency(struct file *file, void *priv,
                                struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct rt_device *rt = video_get_drvdata(dev);
+       struct rt_device *rt = video_drvdata(file);
 
        f->type = V4L2_TUNER_RADIO;
        f->frequency = rt->curfreq;
 static int vidioc_g_ctrl(struct file *file, void *priv,
                                struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct rt_device *rt = video_get_drvdata(dev);
+       struct rt_device *rt = video_drvdata(file);
 
        switch (ctrl->id) {
        case V4L2_CID_AUDIO_MUTE:
 static int vidioc_s_ctrl(struct file *file, void *priv,
                                struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct rt_device *rt = video_get_drvdata(dev);
+       struct rt_device *rt = video_drvdata(file);
 
        switch (ctrl->id) {
        case V4L2_CID_AUDIO_MUTE:
 
                                        struct v4l2_tuner *v)
 {
        int mult;
-       struct video_device *dev = video_devdata(file);
-       struct fmi_device *fmi = video_get_drvdata(dev);
+       struct fmi_device *fmi = video_drvdata(file);
 
        if (v->index > 0)
                return -EINVAL;
 static int vidioc_s_frequency(struct file *file, void *priv,
                                        struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct fmi_device *fmi = video_get_drvdata(dev);
+       struct fmi_device *fmi = video_drvdata(file);
 
        if (!(fmi->flags & V4L2_TUNER_CAP_LOW))
                f->frequency *= 1000;
 static int vidioc_g_frequency(struct file *file, void *priv,
                                        struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct fmi_device *fmi = video_get_drvdata(dev);
+       struct fmi_device *fmi = video_drvdata(file);
 
        f->type = V4L2_TUNER_RADIO;
        f->frequency = fmi->curfreq;
 static int vidioc_g_ctrl(struct file *file, void *priv,
                                        struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct fmi_device *fmi = video_get_drvdata(dev);
+       struct fmi_device *fmi = video_drvdata(file);
 
        switch (ctrl->id) {
        case V4L2_CID_AUDIO_MUTE:
 static int vidioc_s_ctrl(struct file *file, void *priv,
                                        struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct fmi_device *fmi = video_get_drvdata(dev);
+       struct fmi_device *fmi = video_drvdata(file);
 
        switch (ctrl->id) {
        case V4L2_CID_AUDIO_MUTE:
 
                                        struct v4l2_tuner *v)
 {
        int mult;
-       struct video_device *dev = video_devdata(file);
-       struct fmr2_device *fmr2 = video_get_drvdata(dev);
+       struct fmr2_device *fmr2 = video_drvdata(file);
 
        if (v->index > 0)
                return -EINVAL;
 static int vidioc_s_frequency(struct file *file, void *priv,
                                        struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct fmr2_device *fmr2 = video_get_drvdata(dev);
+       struct fmr2_device *fmr2 = video_drvdata(file);
 
        if (!(fmr2->flags & V4L2_TUNER_CAP_LOW))
                f->frequency *= 1000;
 static int vidioc_g_frequency(struct file *file, void *priv,
                                        struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct fmr2_device *fmr2 = video_get_drvdata(dev);
+       struct fmr2_device *fmr2 = video_drvdata(file);
 
        f->type = V4L2_TUNER_RADIO;
        f->frequency = fmr2->curfreq;
 static int vidioc_g_ctrl(struct file *file, void *priv,
                                        struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct fmr2_device *fmr2 = video_get_drvdata(dev);
+       struct fmr2_device *fmr2 = video_drvdata(file);
 
        switch (ctrl->id) {
        case V4L2_CID_AUDIO_MUTE:
 static int vidioc_s_ctrl(struct file *file, void *priv,
                                        struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct fmr2_device *fmr2 = video_get_drvdata(dev);
+       struct fmr2_device *fmr2 = video_drvdata(file);
 
        switch (ctrl->id) {
        case V4L2_CID_AUDIO_MUTE:
 
 static ssize_t si470x_fops_read(struct file *file, char __user *buf,
                size_t count, loff_t *ppos)
 {
-       struct si470x_device *radio = video_get_drvdata(video_devdata(file));
+       struct si470x_device *radio = video_drvdata(file);
        int retval = 0;
        unsigned int block_count = 0;
 
 static unsigned int si470x_fops_poll(struct file *file,
                struct poll_table_struct *pts)
 {
-       struct si470x_device *radio = video_get_drvdata(video_devdata(file));
+       struct si470x_device *radio = video_drvdata(file);
        int retval = 0;
 
        /* switch on rds reception */
  */
 static int si470x_fops_open(struct inode *inode, struct file *file)
 {
-       struct si470x_device *radio = video_get_drvdata(video_devdata(file));
+       struct si470x_device *radio = video_drvdata(file);
        int retval;
 
        lock_kernel();
  */
 static int si470x_fops_release(struct inode *inode, struct file *file)
 {
-       struct si470x_device *radio = video_get_drvdata(video_devdata(file));
+       struct si470x_device *radio = video_drvdata(file);
        int retval = 0;
 
        /* safety check */
 static int si470x_vidioc_g_ctrl(struct file *file, void *priv,
                struct v4l2_control *ctrl)
 {
-       struct si470x_device *radio = video_get_drvdata(video_devdata(file));
+       struct si470x_device *radio = video_drvdata(file);
        int retval = 0;
 
        /* safety checks */
 static int si470x_vidioc_s_ctrl(struct file *file, void *priv,
                struct v4l2_control *ctrl)
 {
-       struct si470x_device *radio = video_get_drvdata(video_devdata(file));
+       struct si470x_device *radio = video_drvdata(file);
        int retval = 0;
 
        /* safety checks */
 static int si470x_vidioc_g_tuner(struct file *file, void *priv,
                struct v4l2_tuner *tuner)
 {
-       struct si470x_device *radio = video_get_drvdata(video_devdata(file));
+       struct si470x_device *radio = video_drvdata(file);
        int retval = 0;
 
        /* safety checks */
 static int si470x_vidioc_s_tuner(struct file *file, void *priv,
                struct v4l2_tuner *tuner)
 {
-       struct si470x_device *radio = video_get_drvdata(video_devdata(file));
+       struct si470x_device *radio = video_drvdata(file);
        int retval = 0;
 
        /* safety checks */
 static int si470x_vidioc_g_frequency(struct file *file, void *priv,
                struct v4l2_frequency *freq)
 {
-       struct si470x_device *radio = video_get_drvdata(video_devdata(file));
+       struct si470x_device *radio = video_drvdata(file);
        int retval = 0;
 
        /* safety checks */
 static int si470x_vidioc_s_frequency(struct file *file, void *priv,
                struct v4l2_frequency *freq)
 {
-       struct si470x_device *radio = video_get_drvdata(video_devdata(file));
+       struct si470x_device *radio = video_drvdata(file);
        int retval = 0;
 
        /* safety checks */
 static int si470x_vidioc_s_hw_freq_seek(struct file *file, void *priv,
                struct v4l2_hw_freq_seek *seek)
 {
-       struct si470x_device *radio = video_get_drvdata(video_devdata(file));
+       struct si470x_device *radio = video_drvdata(file);
        int retval = 0;
 
        /* safety checks */
 
 static int vidioc_g_tuner(struct file *file, void *priv,
                                        struct v4l2_tuner *v)
 {
-       struct video_device *dev = video_devdata(file);
-       struct tt_device *tt = video_get_drvdata(dev);
+       struct tt_device *tt = video_drvdata(file);
 
        if (v->index > 0)
                return -EINVAL;
 static int vidioc_s_frequency(struct file *file, void *priv,
                                        struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct tt_device *tt = video_get_drvdata(dev);
+       struct tt_device *tt = video_drvdata(file);
 
        tt->curfreq = f->frequency;
        tt_setfreq(tt, tt->curfreq);
 static int vidioc_g_frequency(struct file *file, void *priv,
                                        struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct tt_device *tt = video_get_drvdata(dev);
+       struct tt_device *tt = video_drvdata(file);
 
        f->type = V4L2_TUNER_RADIO;
        f->frequency = tt->curfreq;
 static int vidioc_g_ctrl(struct file *file, void *priv,
                                        struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct tt_device *tt = video_get_drvdata(dev);
+       struct tt_device *tt = video_drvdata(file);
 
        switch (ctrl->id) {
        case V4L2_CID_AUDIO_MUTE:
 static int vidioc_s_ctrl(struct file *file, void *priv,
                                        struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct tt_device *tt = video_get_drvdata(dev);
+       struct tt_device *tt = video_drvdata(file);
 
        switch (ctrl->id) {
        case V4L2_CID_AUDIO_MUTE:
 
 static int vidioc_s_frequency(struct file *file, void *priv,
                                        struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct typhoon_device *typhoon = video_get_drvdata(dev);
+       struct typhoon_device *typhoon = video_drvdata(file);
 
        typhoon->curfreq = f->frequency;
        typhoon_setfreq(typhoon, typhoon->curfreq);
 static int vidioc_g_frequency(struct file *file, void *priv,
                                        struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct typhoon_device *typhoon = video_get_drvdata(dev);
+       struct typhoon_device *typhoon = video_drvdata(file);
 
        f->type = V4L2_TUNER_RADIO;
        f->frequency = typhoon->curfreq;
 static int vidioc_g_ctrl(struct file *file, void *priv,
                                        struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct typhoon_device *typhoon = video_get_drvdata(dev);
+       struct typhoon_device *typhoon = video_drvdata(file);
 
        switch (ctrl->id) {
        case V4L2_CID_AUDIO_MUTE:
 static int vidioc_s_ctrl (struct file *file, void *priv,
                                        struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct typhoon_device *typhoon = video_get_drvdata(dev);
+       struct typhoon_device *typhoon = video_drvdata(file);
 
        switch (ctrl->id) {
        case V4L2_CID_AUDIO_MUTE:
 
 static int vidioc_g_tuner(struct file *file, void *priv,
                                        struct v4l2_tuner *v)
 {
-       struct video_device *dev = video_devdata(file);
-       struct zol_device *zol = video_get_drvdata(dev);
+       struct zol_device *zol = video_drvdata(file);
 
        if (v->index > 0)
                return -EINVAL;
 static int vidioc_s_frequency(struct file *file, void *priv,
                                        struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct zol_device *zol = video_get_drvdata(dev);
+       struct zol_device *zol = video_drvdata(file);
 
        zol->curfreq = f->frequency;
        zol_setfreq(zol, zol->curfreq);
 static int vidioc_g_frequency(struct file *file, void *priv,
                                        struct v4l2_frequency *f)
 {
-       struct video_device *dev = video_devdata(file);
-       struct zol_device *zol = video_get_drvdata(dev);
+       struct zol_device *zol = video_drvdata(file);
 
        f->type = V4L2_TUNER_RADIO;
        f->frequency = zol->curfreq;
 static int vidioc_g_ctrl(struct file *file, void *priv,
                                struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct zol_device *zol = video_get_drvdata(dev);
+       struct zol_device *zol = video_drvdata(file);
 
        switch (ctrl->id) {
        case V4L2_CID_AUDIO_MUTE:
 static int vidioc_s_ctrl(struct file *file, void *priv,
                                struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct zol_device *zol = video_get_drvdata(dev);
+       struct zol_device *zol = video_drvdata(file);
 
        switch (ctrl->id) {
        case V4L2_CID_AUDIO_MUTE:
 
  *****************************************************************************/
 static int cpia2_open(struct inode *inode, struct file *file)
 {
-       struct video_device *dev = video_devdata(file);
-       struct camera_data *cam = video_get_drvdata(dev);
+       struct camera_data *cam = video_drvdata(file);
        int retval = 0;
 
        if (!cam) {
 static ssize_t cpia2_v4l_read(struct file *file, char __user *buf, size_t count,
                              loff_t *off)
 {
-       struct video_device *dev = video_devdata(file);
-       struct camera_data *cam = video_get_drvdata(dev);
+       struct camera_data *cam = video_drvdata(file);
        int noblock = file->f_flags&O_NONBLOCK;
 
        struct cpia2_fh *fh = file->private_data;
  *****************************************************************************/
 static unsigned int cpia2_v4l_poll(struct file *filp, struct poll_table_struct *wait)
 {
-       struct video_device *dev = video_devdata(filp);
-       struct camera_data *cam = video_get_drvdata(dev);
-
+       struct camera_data *cam = video_drvdata(filp);
        struct cpia2_fh *fh = filp->private_data;
 
        if(!cam)
 static int cpia2_do_ioctl(struct inode *inode, struct file *file,
                          unsigned int ioctl_nr, void *arg)
 {
-       struct video_device *dev = video_devdata(file);
-       struct camera_data *cam = video_get_drvdata(dev);
+       struct camera_data *cam = video_drvdata(file);
        int retval = 0;
 
        if (!cam)
  *****************************************************************************/
 static int cpia2_mmap(struct file *file, struct vm_area_struct *area)
 {
+       struct camera_data *cam = video_drvdata(file);
        int retval;
-       struct video_device *dev = video_devdata(file);
-       struct camera_data *cam = video_get_drvdata(dev);
 
        /* Priority check */
        struct cpia2_fh *fh = file->private_data;
 
        if (!down_read_trylock(&et61x251_dev_lock))
                return -ERESTARTSYS;
 
-       cam = video_get_drvdata(video_devdata(filp));
+       cam = video_drvdata(filp);
 
        if (wait_for_completion_interruptible(&cam->probe)) {
                up_read(&et61x251_dev_lock);
 
        down_write(&et61x251_dev_lock);
 
-       cam = video_get_drvdata(video_devdata(filp));
+       cam = video_drvdata(filp);
 
        et61x251_stop_transfer(cam);
        et61x251_release_buffers(cam);
 et61x251_read(struct file* filp, char __user * buf,
              size_t count, loff_t* f_pos)
 {
-       struct et61x251_device* cam = video_get_drvdata(video_devdata(filp));
+       struct et61x251_device *cam = video_drvdata(filp);
        struct et61x251_frame_t* f, * i;
        unsigned long lock_flags;
        long timeout;
 
 static unsigned int et61x251_poll(struct file *filp, poll_table *wait)
 {
-       struct et61x251_device* cam = video_get_drvdata(video_devdata(filp));
+       struct et61x251_device *cam = video_drvdata(filp);
        struct et61x251_frame_t* f;
        unsigned long lock_flags;
        unsigned int mask = 0;
 
 static int et61x251_mmap(struct file* filp, struct vm_area_struct *vma)
 {
-       struct et61x251_device* cam = video_get_drvdata(video_devdata(filp));
+       struct et61x251_device *cam = video_drvdata(filp);
        unsigned long size = vma->vm_end - vma->vm_start,
                      start = vma->vm_start;
        void *pos;
 static int et61x251_ioctl_v4l2(struct inode* inode, struct file* filp,
                               unsigned int cmd, void __user * arg)
 {
-       struct et61x251_device* cam = video_get_drvdata(video_devdata(filp));
+       struct et61x251_device *cam = video_drvdata(filp);
 
        switch (cmd) {
 
 static int et61x251_ioctl(struct inode* inode, struct file* filp,
                         unsigned int cmd, unsigned long arg)
 {
-       struct et61x251_device* cam = video_get_drvdata(video_devdata(filp));
+       struct et61x251_device *cam = video_drvdata(filp);
        int err = 0;
 
        if (mutex_lock_interruptible(&cam->fileop_mutex))
 
 static int saa5246a_detach(struct i2c_client *client)
 {
        struct video_device *vd = i2c_get_clientdata(client);
+
        i2c_detach_client(client);
        video_unregister_device(vd);
        kfree(video_get_drvdata(vd));
 static int do_saa5246a_ioctl(struct inode *inode, struct file *file,
                            unsigned int cmd, void *arg)
 {
-       struct video_device *vd = video_devdata(file);
-       struct saa5246a_device *t = video_get_drvdata(vd);
+       struct saa5246a_device *t = video_drvdata(file);
 
        switch(cmd)
        {
 static int saa5246a_ioctl(struct inode *inode, struct file *file,
                         unsigned int cmd, unsigned long arg)
 {
-       struct video_device *vd = video_devdata(file);
-       struct saa5246a_device *t = video_get_drvdata(vd);
+       struct saa5246a_device *t = video_drvdata(file);
        int err;
 
        cmd = vtx_fix_command(cmd);
 
 static int saa5246a_open(struct inode *inode, struct file *file)
 {
-       struct video_device *vd = video_devdata(file);
-       struct saa5246a_device *t = video_get_drvdata(vd);
+       struct saa5246a_device *t = video_drvdata(file);
 
        if (t->client == NULL)
                return -ENODEV;
 
 static int saa5246a_release(struct inode *inode, struct file *file)
 {
-       struct video_device *vd = video_devdata(file);
-       struct saa5246a_device *t = video_get_drvdata(vd);
+       struct saa5246a_device *t = video_drvdata(file);
 
        /* Stop all acquisition circuits. */
        i2c_senddata(t, SAA5246A_REGISTER_R1,
 
                            unsigned int cmd, void *arg)
 {
        static int virtual_mode = false;
-       struct video_device *vd = video_devdata(file);
-       struct saa5249_device *t = video_get_drvdata(vd);
+       struct saa5249_device *t = video_drvdata(file);
 
        switch(cmd)
        {
 static int saa5249_ioctl(struct inode *inode, struct file *file,
                         unsigned int cmd, unsigned long arg)
 {
-       struct video_device *vd = video_devdata(file);
-       struct saa5249_device *t = video_get_drvdata(vd);
+       struct saa5249_device *t = video_drvdata(file);
        int err;
 
        cmd = vtx_fix_command(cmd);
 
 static int saa5249_open(struct inode *inode, struct file *file)
 {
-       struct video_device *vd = video_devdata(file);
-       struct saa5249_device *t = video_get_drvdata(vd);
+       struct saa5249_device *t = video_drvdata(file);
        int pgbuf;
 
        if (t->client == NULL)
 
 static int saa5249_release(struct inode *inode, struct file *file)
 {
-       struct video_device *vd = video_devdata(file);
-       struct saa5249_device *t = video_get_drvdata(vd);
+       struct saa5249_device *t = video_drvdata(file);
 
        i2c_senddata(t, 1, 0x20, -1);           /* Turn off CCT */
        i2c_senddata(t, 5, 3, 3, -1);           /* Turn off TV-display */
 
        if (!down_read_trylock(&sn9c102_dev_lock))
                return -ERESTARTSYS;
 
-       cam = video_get_drvdata(video_devdata(filp));
+       cam = video_drvdata(filp);
 
        if (wait_for_completion_interruptible(&cam->probe)) {
                up_read(&sn9c102_dev_lock);
 
        down_write(&sn9c102_dev_lock);
 
-       cam = video_get_drvdata(video_devdata(filp));
+       cam = video_drvdata(filp);
 
        sn9c102_stop_transfer(cam);
        sn9c102_release_buffers(cam);
 static ssize_t
 sn9c102_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos)
 {
-       struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp));
+       struct sn9c102_device *cam = video_drvdata(filp);
        struct sn9c102_frame_t* f, * i;
        unsigned long lock_flags;
        long timeout;
 
 static unsigned int sn9c102_poll(struct file *filp, poll_table *wait)
 {
-       struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp));
+       struct sn9c102_device *cam = video_drvdata(filp);
        struct sn9c102_frame_t* f;
        unsigned long lock_flags;
        unsigned int mask = 0;
 
 static int sn9c102_mmap(struct file* filp, struct vm_area_struct *vma)
 {
-       struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp));
+       struct sn9c102_device *cam = video_drvdata(filp);
        unsigned long size = vma->vm_end - vma->vm_start,
                      start = vma->vm_start;
        void *pos;
 static int sn9c102_ioctl_v4l2(struct inode* inode, struct file* filp,
                              unsigned int cmd, void __user * arg)
 {
-       struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp));
+       struct sn9c102_device *cam = video_drvdata(filp);
 
        switch (cmd) {
 
 static int sn9c102_ioctl(struct inode* inode, struct file* filp,
                         unsigned int cmd, unsigned long arg)
 {
-       struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp));
+       struct sn9c102_device *cam = video_drvdata(filp);
        int err = 0;
 
        if (mutex_lock_interruptible(&cam->fileop_mutex))
 
 static int
 vicam_open(struct inode *inode, struct file *file)
 {
-       struct video_device *dev = video_devdata(file);
-       struct vicam_camera *cam = video_get_drvdata(dev);
+       struct vicam_camera *cam = video_drvdata(file);
 
        DBG("open\n");
 
 
  */
 static int usbvision_v4l2_open(struct inode *inode, struct file *file)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
        int errCode = 0;
 
        PDEBUG(DBG_IO, "open");
  */
 static int usbvision_v4l2_close(struct inode *inode, struct file *file)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
 
        PDEBUG(DBG_IO, "close");
        mutex_lock(&usbvision->lock);
 static int vidioc_g_register (struct file *file, void *priv,
                                struct v4l2_register *reg)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
        int errCode;
 
        if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
 static int vidioc_s_register (struct file *file, void *priv,
                                struct v4l2_register *reg)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
        int errCode;
 
        if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
 static int vidioc_querycap (struct file *file, void  *priv,
                                        struct v4l2_capability *vc)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
 
        strlcpy(vc->driver, "USBVision", sizeof(vc->driver));
        strlcpy(vc->card,
 static int vidioc_enum_input (struct file *file, void *priv,
                                struct v4l2_input *vi)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
        int chan;
 
        if ((vi->index >= usbvision->video_inputs) || (vi->index < 0) )
 
 static int vidioc_g_input (struct file *file, void *priv, unsigned int *input)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
 
        *input = usbvision->ctl_input;
        return 0;
 
 static int vidioc_s_input (struct file *file, void *priv, unsigned int input)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
 
        if ((input >= usbvision->video_inputs) || (input < 0) )
                return -EINVAL;
 
 static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *id)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
+
        usbvision->tvnormId=*id;
 
        mutex_lock(&usbvision->lock);
 static int vidioc_g_tuner (struct file *file, void *priv,
                                struct v4l2_tuner *vt)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
 
        if (!usbvision->have_tuner || vt->index)        // Only tuner 0
                return -EINVAL;
 static int vidioc_s_tuner (struct file *file, void *priv,
                                struct v4l2_tuner *vt)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
 
        // Only no or one tuner for now
        if (!usbvision->have_tuner || vt->index)
 static int vidioc_g_frequency (struct file *file, void *priv,
                                struct v4l2_frequency *freq)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
 
        freq->tuner = 0; // Only one tuner
        if(usbvision->radio) {
 static int vidioc_s_frequency (struct file *file, void *priv,
                                struct v4l2_frequency *freq)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
 
        // Only no or one tuner for now
        if (!usbvision->have_tuner || freq->tuner)
 
 static int vidioc_g_audio (struct file *file, void *priv, struct v4l2_audio *a)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
 
        memset(a,0,sizeof(*a));
        if(usbvision->radio) {
 static int vidioc_queryctrl (struct file *file, void *priv,
                            struct v4l2_queryctrl *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
        int id=ctrl->id;
 
        memset(ctrl,0,sizeof(*ctrl));
 static int vidioc_g_ctrl (struct file *file, void *priv,
                                struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
        call_i2c_clients(usbvision, VIDIOC_G_CTRL, ctrl);
 
        return 0;
 static int vidioc_s_ctrl (struct file *file, void *priv,
                                struct v4l2_control *ctrl)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
        call_i2c_clients(usbvision, VIDIOC_S_CTRL, ctrl);
 
        return 0;
 static int vidioc_reqbufs (struct file *file,
                           void *priv, struct v4l2_requestbuffers *vr)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
        int ret;
 
        RESTRICT_TO_RANGE(vr->count,1,USBVISION_NUMFRAMES);
 static int vidioc_querybuf (struct file *file,
                            void *priv, struct v4l2_buffer *vb)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
        struct usbvision_frame *frame;
 
        /* FIXME : must control
 
 static int vidioc_qbuf (struct file *file, void *priv, struct v4l2_buffer *vb)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
        struct usbvision_frame *frame;
        unsigned long lock_flags;
 
 
 static int vidioc_dqbuf (struct file *file, void *priv, struct v4l2_buffer *vb)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
        int ret;
        struct usbvision_frame *f;
        unsigned long lock_flags;
 
 static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
        int b=V4L2_BUF_TYPE_VIDEO_CAPTURE;
 
        usbvision->streaming = Stream_On;
 static int vidioc_streamoff(struct file *file,
                            void *priv, enum v4l2_buf_type type)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
        int b=V4L2_BUF_TYPE_VIDEO_CAPTURE;
 
        if (type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
 static int vidioc_g_fmt_vid_cap (struct file *file, void *priv,
                                        struct v4l2_format *vf)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
        vf->fmt.pix.width = usbvision->curwidth;
        vf->fmt.pix.height = usbvision->curheight;
        vf->fmt.pix.pixelformat = usbvision->palette.format;
 static int vidioc_try_fmt_vid_cap (struct file *file, void *priv,
                               struct v4l2_format *vf)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
        int formatIdx;
 
        /* Find requested format in available ones */
 static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
                               struct v4l2_format *vf)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
        int ret;
 
        if( 0 != (ret=vidioc_try_fmt_vid_cap (file, priv, vf)) ) {
 static ssize_t usbvision_v4l2_read(struct file *file, char __user *buf,
                      size_t count, loff_t *ppos)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
        int noblock = file->f_flags & O_NONBLOCK;
        unsigned long lock_flags;
 
                start = vma->vm_start;
        void *pos;
        u32 i;
-
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
 
        PDEBUG(DBG_MMAP, "mmap");
 
  */
 static int usbvision_radio_open(struct inode *inode, struct file *file)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
        int errCode = 0;
 
        PDEBUG(DBG_IO, "%s:", __func__);
 
 static int usbvision_radio_close(struct inode *inode, struct file *file)
 {
-       struct video_device *dev = video_devdata(file);
-       struct usb_usbvision *usbvision =
-               (struct usb_usbvision *) video_get_drvdata(dev);
+       struct usb_usbvision *usbvision = video_drvdata(file);
        int errCode = 0;
 
        PDEBUG(DBG_IO, "");
 
 
 static int uvc_v4l2_open(struct inode *inode, struct file *file)
 {
-       struct video_device *vdev;
        struct uvc_video_device *video;
        struct uvc_fh *handle;
        int ret = 0;
 
        uvc_trace(UVC_TRACE_CALLS, "uvc_v4l2_open\n");
        mutex_lock(&uvc_driver.open_mutex);
-       vdev = video_devdata(file);
-       video = video_get_drvdata(vdev);
+       video = video_drvdata(file);
 
        if (video->dev->state & UVC_DEV_DISCONNECTED) {
                ret = -ENODEV;
 
 static int uvc_v4l2_release(struct inode *inode, struct file *file)
 {
-       struct video_device *vdev = video_devdata(file);
-       struct uvc_video_device *video = video_get_drvdata(vdev);
+       struct uvc_video_device *video = video_drvdata(file);
        struct uvc_fh *handle = (struct uvc_fh *)file->private_data;
 
        uvc_trace(UVC_TRACE_CALLS, "uvc_v4l2_release\n");
 
 static int uvc_v4l2_mmap(struct file *file, struct vm_area_struct *vma)
 {
-       struct video_device *vdev = video_devdata(file);
-       struct uvc_video_device *video = video_get_drvdata(vdev);
+       struct uvc_video_device *video = video_drvdata(file);
        struct uvc_buffer *uninitialized_var(buffer);
        struct page *page;
        unsigned long addr, start, size;
 
 static unsigned int uvc_v4l2_poll(struct file *file, poll_table *wait)
 {
-       struct video_device *vdev = video_devdata(file);
-       struct uvc_video_device *video = video_get_drvdata(vdev);
+       struct uvc_video_device *video = video_drvdata(file);
 
        uvc_trace(UVC_TRACE_CALLS, "uvc_v4l2_poll\n");
 
 
 
 static int vino_open(struct inode *inode, struct file *file)
 {
-       struct video_device *dev = video_devdata(file);
-       struct vino_channel_settings *vcs = video_get_drvdata(dev);
+       struct vino_channel_settings *vcs = video_drvdata(file);
        int ret = 0;
        dprintk("open(): channel = %c\n",
               (vcs->channel == VINO_CHANNEL_A) ? 'A' : 'B');
 
 static int vino_close(struct inode *inode, struct file *file)
 {
-       struct video_device *dev = video_devdata(file);
-       struct vino_channel_settings *vcs = video_get_drvdata(dev);
+       struct vino_channel_settings *vcs = video_drvdata(file);
        dprintk("close():\n");
 
        mutex_lock(&vcs->mutex);
 
 static int vino_mmap(struct file *file, struct vm_area_struct *vma)
 {
-       struct video_device *dev = video_devdata(file);
-       struct vino_channel_settings *vcs = video_get_drvdata(dev);
+       struct vino_channel_settings *vcs = video_drvdata(file);
 
        unsigned long start = vma->vm_start;
        unsigned long size = vma->vm_end - vma->vm_start;
 
 static unsigned int vino_poll(struct file *file, poll_table *pt)
 {
-       struct video_device *dev = video_devdata(file);
-       struct vino_channel_settings *vcs = video_get_drvdata(dev);
+       struct vino_channel_settings *vcs = video_drvdata(file);
        unsigned int outgoing;
        unsigned int ret = 0;
 
 static int vino_do_ioctl(struct inode *inode, struct file *file,
                      unsigned int cmd, void *arg)
 {
-       struct video_device *dev = video_devdata(file);
-       struct vino_channel_settings *vcs = video_get_drvdata(dev);
+       struct vino_channel_settings *vcs = video_drvdata(file);
 
 #ifdef VINO_DEBUG
        switch (_IOC_TYPE(cmd)) {
 static int vino_ioctl(struct inode *inode, struct file *file,
                      unsigned int cmd, unsigned long arg)
 {
-       struct video_device *dev = video_devdata(file);
-       struct vino_channel_settings *vcs = video_get_drvdata(dev);
+       struct vino_channel_settings *vcs = video_drvdata(file);
        int ret;
 
        if (mutex_lock_interruptible(&vcs->mutex))
 
 
 static int w9966_exclusive_open(struct inode *inode, struct file *file)
 {
-       struct video_device *vdev = video_devdata(file);
-       struct w9966_dev *cam = video_get_drvdata(vdev);
+       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 = video_get_drvdata(vdev);
+       struct w9966_dev *cam = video_drvdata(file);
 
        clear_bit(0, &cam->in_use);
        return 0;
 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 = video_get_drvdata(vdev);
+       struct w9966_dev *cam = video_drvdata(file);
 
        switch(cmd)
        {
 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 = video_get_drvdata(vdev);
+       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;
 
        if (!down_read_trylock(&zc0301_dev_lock))
                return -EAGAIN;
 
-       cam = video_get_drvdata(video_devdata(filp));
+       cam = video_drvdata(filp);
 
        if (wait_for_completion_interruptible(&cam->probe)) {
                up_read(&zc0301_dev_lock);
 
        down_write(&zc0301_dev_lock);
 
-       cam = video_get_drvdata(video_devdata(filp));
+       cam = video_drvdata(filp);
 
        zc0301_stop_transfer(cam);
        zc0301_release_buffers(cam);
 static ssize_t
 zc0301_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos)
 {
-       struct zc0301_device* cam = video_get_drvdata(video_devdata(filp));
+       struct zc0301_device *cam = video_drvdata(filp);
        struct zc0301_frame_t* f, * i;
        unsigned long lock_flags;
        long timeout;
 
 static unsigned int zc0301_poll(struct file *filp, poll_table *wait)
 {
-       struct zc0301_device* cam = video_get_drvdata(video_devdata(filp));
+       struct zc0301_device *cam = video_drvdata(filp);
        struct zc0301_frame_t* f;
        unsigned long lock_flags;
        unsigned int mask = 0;
 
 static int zc0301_mmap(struct file* filp, struct vm_area_struct *vma)
 {
-       struct zc0301_device* cam = video_get_drvdata(video_devdata(filp));
+       struct zc0301_device *cam = video_drvdata(filp);
        unsigned long size = vma->vm_end - vma->vm_start,
                      start = vma->vm_start;
        void *pos;
 static int zc0301_ioctl_v4l2(struct inode* inode, struct file* filp,
                             unsigned int cmd, void __user * arg)
 {
-       struct zc0301_device* cam = video_get_drvdata(video_devdata(filp));
+       struct zc0301_device *cam = video_drvdata(filp);
 
        switch (cmd) {
 
 static int zc0301_ioctl(struct inode* inode, struct file* filp,
                        unsigned int cmd, unsigned long arg)
 {
-       struct zc0301_device* cam = video_get_drvdata(video_devdata(filp));
+       struct zc0301_device *cam = video_drvdata(filp);
        int err = 0;
 
        if (mutex_lock_interruptible(&cam->fileop_mutex))
 
 static int snd_tea575x_ioctl(struct inode *inode, struct file *file,
                             unsigned int cmd, unsigned long data)
 {
-       struct video_device *dev = video_devdata(file);
-       struct snd_tea575x *tea = video_get_drvdata(dev);
+       struct snd_tea575x *tea = video_drvdata(file);
        void __user *arg = (void __user *)data;
        
        switch(cmd) {
 
 static int snd_tea575x_exclusive_open(struct inode *inode, struct file *file)
 {
-       struct video_device *dev = video_devdata(file);
-       struct snd_tea575x *tea = video_get_drvdata(dev);
+       struct snd_tea575x *tea = video_drvdata(file);
 
        return test_and_set_bit(0, &tea->in_use) ? -EBUSY : 0;
 }
 
 static int snd_tea575x_exclusive_release(struct inode *inode, struct file *file)
 {
-       struct video_device *dev = video_devdata(file);
-       struct snd_tea575x *tea = video_get_drvdata(dev);
+       struct snd_tea575x *tea = video_drvdata(file);
 
        clear_bit(0, &tea->in_use);
        return 0;