summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/usbvideo/vicam.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-08-29 18:40:09 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-08-29 18:40:09 -0300
commit3308516a2fe5ca58a64f65fe813de98f3637d653 (patch)
tree0974c897287c884849110e16586c0f34d8f47957 /linux/drivers/media/video/usbvideo/vicam.c
parenta9bf92eb33a4ad79b8093c90379fb9d7519f1c88 (diff)
parente17ae483fc1526567d78cf551747362614aaae95 (diff)
downloadmediapointer-dvb-s2-3308516a2fe5ca58a64f65fe813de98f3637d653.tar.gz
mediapointer-dvb-s2-3308516a2fe5ca58a64f65fe813de98f3637d653.tar.bz2
merge: http://linuxtv.org/hg/~gliakhovetski/v4l-dvb
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/usbvideo/vicam.c')
-rw-r--r--linux/drivers/media/video/usbvideo/vicam.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/linux/drivers/media/video/usbvideo/vicam.c b/linux/drivers/media/video/usbvideo/vicam.c
index e7330fe4f..bad26ccf8 100644
--- a/linux/drivers/media/video/usbvideo/vicam.c
+++ b/linux/drivers/media/video/usbvideo/vicam.c
@@ -782,9 +782,8 @@ vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsign
static int
vicam_open(struct inode *inode, struct file *file)
{
- struct video_device *dev = video_devdata(file);
- struct vicam_camera *cam =
- (struct vicam_camera *) dev->priv;
+ struct vicam_camera *cam = video_drvdata(file);
+
DBG("open\n");
if (!cam) {
@@ -1111,6 +1110,7 @@ static struct video_device vicam_template = {
.name = "ViCam-based USB Camera",
.fops = &vicam_fops,
.minor = -1,
+ .release = video_device_release_empty,
};
/* table of devices that work with this driver */
@@ -1175,14 +1175,13 @@ vicam_probe( struct usb_interface *intf, const struct usb_device_id *id)
mutex_init(&cam->cam_lock);
- memcpy(&cam->vdev, &vicam_template,
- sizeof (vicam_template));
- cam->vdev.priv = cam; // sort of a reverse mapping for those functions that get vdev only
+ memcpy(&cam->vdev, &vicam_template, sizeof(vicam_template));
+ video_set_drvdata(&cam->vdev, cam);
cam->udev = dev;
cam->bulkEndpoint = bulkEndpoint;
- if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, -1) == -1) {
+ if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, -1) < 0) {
kfree(cam);
printk(KERN_WARNING "video_register_device failed\n");
return -EIO;