The patch number 11245 was added via Janne Grunau <[email protected]>
to http://linuxtv.org/hg/v4l-dvb master development tree.
Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel
If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List <[email protected]>
------
From: Janne Grunau <[email protected]>
hdpvr: add struct v4l2_device
Priority: normal
Signed-off-by: Janne Grunau <[email protected]>
---
linux/drivers/media/video/hdpvr/hdpvr-core.c | 9 +++++++++
linux/drivers/media/video/hdpvr/hdpvr.h | 4 ++++
2 files changed, 13 insertions(+)
diff -r b1596c6517c9 -r 06e3bc4acdcf
linux/drivers/media/video/hdpvr/hdpvr-core.c
--- a/linux/drivers/media/video/hdpvr/hdpvr-core.c Thu Mar 26 20:47:48
2009 +0000
+++ b/linux/drivers/media/video/hdpvr/hdpvr-core.c Sat Mar 28 00:01:40
2009 +0100
@@ -278,6 +278,13 @@ static int hdpvr_probe(struct usb_interf
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);
@@ -387,6 +394,7 @@ static void hdpvr_disconnect(struct usb_
/* 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);
@@ -413,6 +421,7 @@ static void hdpvr_disconnect(struct usb_
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);
}
diff -r b1596c6517c9 -r 06e3bc4acdcf linux/drivers/media/video/hdpvr/hdpvr.h
--- a/linux/drivers/media/video/hdpvr/hdpvr.h Thu Mar 26 20:47:48 2009 +0000
+++ b/linux/drivers/media/video/hdpvr/hdpvr.h Sat Mar 28 00:01:40 2009 +0100
@@ -14,6 +14,8 @@
#include <linux/mutex.h>
#include <linux/workqueue.h>
#include <linux/videodev2.h>
+
+#include <media/v4l2-device.h>
#define HDPVR_MAJOR_VERSION 0
#define HDPVR_MINOR_VERSION 2
@@ -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;
---
Patch is available at:
http://linuxtv.org/hg/v4l-dvb/rev/06e3bc4acdcfccf2638b368340ad74d1b2e99f75
_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits