diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2008-11-19 20:59:51 +0100 |
---|---|---|
committer | Jean-Francois Moine <moinejf@free.fr> | 2008-11-19 20:59:51 +0100 |
commit | 7b1618ce2f951b1d38a9d687ddc0c48b47ed41db (patch) | |
tree | 2a30d0241577144aba5e45e4392b8d827d4c0cd3 /linux | |
parent | ae86190074546910731428852528b67d13dabfde (diff) | |
download | mediapointer-dvb-s2-7b1618ce2f951b1d38a9d687ddc0c48b47ed41db.tar.gz mediapointer-dvb-s2-7b1618ce2f951b1d38a9d687ddc0c48b47ed41db.tar.bz2 |
gspca: Revert the previous change.
From: Jean-Francois Moine <moinejf@free.fr>
Priority: normal
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/video/gspca/gspca.c | 28 | ||||
-rw-r--r-- | linux/drivers/media/video/gspca/gspca.h | 2 |
2 files changed, 16 insertions, 14 deletions
diff --git a/linux/drivers/media/video/gspca/gspca.c b/linux/drivers/media/video/gspca/gspca.c index 35f504440..4e3833a00 100644 --- a/linux/drivers/media/video/gspca/gspca.c +++ b/linux/drivers/media/video/gspca/gspca.c @@ -897,7 +897,7 @@ static int dev_open(struct inode *inode, struct file *file) int ret; PDEBUG(D_STREAM, "%s open", current->comm); - gspca_dev = video_drvdata(file); + gspca_dev = (struct gspca_dev *) video_devdata(file); if (mutex_lock_interruptible(&gspca_dev->queue_lock)) return -ERESTARTSYS; if (!gspca_dev->present) { @@ -925,10 +925,10 @@ static int dev_open(struct inode *inode, struct file *file) #ifdef GSPCA_DEBUG /* activate the v4l2 debug */ if (gspca_debug & D_V4L2) - gspca_dev->vdev->debug |= V4L2_DEBUG_IOCTL + gspca_dev->vdev.debug |= V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG; else - gspca_dev->vdev->debug &= ~(V4L2_DEBUG_IOCTL + gspca_dev->vdev.debug &= ~(V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG); #endif ret = 0; @@ -1790,6 +1790,11 @@ out: return ret; } +static void dev_release(struct video_device *vfd) +{ + /* nothing */ +} + static struct file_operations dev_fops = { .owner = THIS_MODULE, .open = dev_open, @@ -1837,7 +1842,7 @@ static struct video_device gspca_template = { .name = "gspca main driver", .fops = &dev_fops, .ioctl_ops = &dev_ioctl_ops, - .release = video_device_release, + .release = dev_release, /* mandatory */ .minor = -1, }; @@ -1907,18 +1912,16 @@ int gspca_dev_probe(struct usb_interface *intf, init_waitqueue_head(&gspca_dev->wq); /* init video stuff */ - gspca_dev->vdev = video_device_alloc(); - memcpy(gspca_dev->vdev, &gspca_template, sizeof gspca_template); - gspca_dev->vdev->parent = &dev->dev; + memcpy(&gspca_dev->vdev, &gspca_template, sizeof gspca_template); + gspca_dev->vdev.parent = &dev->dev; + gspca_dev->vdev.fops = &dev_fops; gspca_dev->module = module; gspca_dev->present = 1; - video_set_drvdata(gspca_dev->vdev, gspca_dev); - ret = video_register_device(gspca_dev->vdev, + ret = video_register_device(&gspca_dev->vdev, VFL_TYPE_GRABBER, video_nr); if (ret < 0) { err("video_register_device err %d", ret); - video_device_release(gspca_dev->vdev); goto out; } @@ -1926,8 +1929,7 @@ int gspca_dev_probe(struct usb_interface *intf, PDEBUG(D_PROBE, "probe ok"); return 0; out: - kfree(gspca_dev->usb_buf); - kfree(gspca_dev); + kref_put(&gspca_dev->kref, gspca_delete); return ret; } EXPORT_SYMBOL(gspca_dev_probe); @@ -1945,7 +1947,7 @@ void gspca_disconnect(struct usb_interface *intf) usb_set_intfdata(intf, NULL); /* We don't want people trying to open up the device */ - video_unregister_device(gspca_dev->vdev); + video_unregister_device(&gspca_dev->vdev); gspca_dev->present = 0; gspca_dev->streaming = 0; diff --git a/linux/drivers/media/video/gspca/gspca.h b/linux/drivers/media/video/gspca/gspca.h index a557738e8..4ff9b8105 100644 --- a/linux/drivers/media/video/gspca/gspca.h +++ b/linux/drivers/media/video/gspca/gspca.h @@ -124,7 +124,7 @@ struct gspca_frame { }; struct gspca_dev { - struct video_device *vdev; + struct video_device vdev; /* !! must be the first item */ struct module *module; /* subdriver handling the device */ struct usb_device *dev; struct kref kref; |