Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306302
b: refs/heads/master
c: 2333565
h: refs/heads/master
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed May 14, 2012
1 parent ebe715f commit a2ca718
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f4c1605a74c46100d93f465238b9962ac9499e36
refs/heads/master: 2333565d94c1efd199782bdedc9f4d9b06198583
13 changes: 10 additions & 3 deletions trunk/drivers/media/video/gspca/gspca.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <linux/ktime.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-fh.h>

#include "gspca.h"

Expand Down Expand Up @@ -1327,6 +1328,7 @@ static void gspca_release(struct video_device *vfd)
video_device_node_name(&gspca_dev->vdev));

v4l2_ctrl_handler_free(gspca_dev->vdev.ctrl_handler);
v4l2_device_unregister(&gspca_dev->v4l2_dev);
kfree(gspca_dev->usb_buf);
kfree(gspca_dev);
}
Expand All @@ -1352,7 +1354,7 @@ static int dev_open(struct file *file)
gspca_dev->vdev.debug &= ~(V4L2_DEBUG_IOCTL
| V4L2_DEBUG_IOCTL_ARG);
#endif
return 0;
return v4l2_fh_open(file);
}

static int dev_close(struct file *file)
Expand All @@ -1378,7 +1380,7 @@ static int dev_close(struct file *file)

PDEBUG(D_STREAM, "close done");

return 0;
return v4l2_fh_release(file);
}

static int vidioc_querycap(struct file *file, void *priv,
Expand Down Expand Up @@ -2345,12 +2347,16 @@ int gspca_dev_probe2(struct usb_interface *intf,
}
}

ret = v4l2_device_register(&intf->dev, &gspca_dev->v4l2_dev);
if (ret)
goto out;
gspca_dev->sd_desc = sd_desc;
gspca_dev->nbufread = 2;
gspca_dev->empty_packet = -1; /* don't check the empty packets */
gspca_dev->vdev = gspca_template;
gspca_dev->vdev.parent = &intf->dev;
gspca_dev->vdev.v4l2_dev = &gspca_dev->v4l2_dev;
video_set_drvdata(&gspca_dev->vdev, gspca_dev);
set_bit(V4L2_FL_USE_FH_PRIO, &gspca_dev->vdev.flags);
gspca_dev->module = module;
gspca_dev->present = 1;

Expand Down Expand Up @@ -2462,6 +2468,7 @@ void gspca_disconnect(struct usb_interface *intf)

/* the device is freed at exit of this function */
gspca_dev->dev = NULL;
v4l2_device_disconnect(&gspca_dev->v4l2_dev);
mutex_unlock(&gspca_dev->usb_lock);

usb_set_intfdata(intf, NULL);
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/media/video/gspca/gspca.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <linux/usb.h>
#include <linux/videodev2.h>
#include <media/v4l2-common.h>
#include <media/v4l2-device.h>
#include <linux/mutex.h>

/* compilation option */
Expand Down Expand Up @@ -159,6 +160,7 @@ struct gspca_frame {
struct gspca_dev {
struct video_device vdev; /* !! must be the first item */
struct module *module; /* subdriver handling the device */
struct v4l2_device v4l2_dev;
struct usb_device *dev;
struct file *capt_file; /* file doing video capture */
#if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
Expand Down

0 comments on commit a2ca718

Please sign in to comment.