Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138343
b: refs/heads/master
c: 06630ae
h: refs/heads/master
i:
  138341: 74de1ff
  138339: 7dc0a66
  138335: 6d7e685
v: v3
  • Loading branch information
Janne Grunau authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent b5280ca commit ae2c922
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0b61dca28909bc548581bec75e3b90faaa7f11fd
refs/heads/master: 06630aec92d6a71658ac1538e2a65af5cfc5f2af
9 changes: 9 additions & 0 deletions trunk/drivers/media/video/hdpvr/hdpvr-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,13 @@ static int hdpvr_probe(struct usb_interface *interface,
err("Out of memory");
goto error;
}

/* register v4l2_device early so it can be used for printks */
if (v4l2_device_register(&interface->dev, &dev->v4l2_dev)) {
err("v4l2_device_register failed");
goto error;
}

mutex_init(&dev->io_mutex);
mutex_init(&dev->i2c_mutex);
mutex_init(&dev->usbc_mutex);
Expand Down Expand Up @@ -387,6 +394,7 @@ static void hdpvr_disconnect(struct usb_interface *interface)
/* prevent more I/O from starting and stop any ongoing */
mutex_lock(&dev->io_mutex);
dev->status = STATUS_DISCONNECTED;
v4l2_device_disconnect(&dev->v4l2_dev);
video_unregister_device(dev->video_dev);
wake_up_interruptible(&dev->wait_data);
wake_up_interruptible(&dev->wait_buffer);
Expand All @@ -413,6 +421,7 @@ static void hdpvr_disconnect(struct usb_interface *interface)
printk(KERN_INFO "Hauppauge HD PVR: device /dev/video%d disconnected\n",
minor);

v4l2_device_unregister(&dev->v4l2_dev);
kfree(dev->usbc_buf);
kfree(dev);
}
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/media/video/hdpvr/hdpvr.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include <linux/workqueue.h>
#include <linux/videodev2.h>

#include <media/v4l2-device.h>

#define HDPVR_MAJOR_VERSION 0
#define HDPVR_MINOR_VERSION 2
#define HDPVR_RELEASE 0
Expand Down Expand Up @@ -65,6 +67,8 @@ struct hdpvr_device {
struct video_device *video_dev;
/* the usb device for this device */
struct usb_device *udev;
/* v4l2-device unused */
struct v4l2_device v4l2_dev;

/* the max packet size of the bulk endpoint */
size_t bulk_in_size;
Expand Down

0 comments on commit ae2c922

Please sign in to comment.