Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06630aec authored by Janne Grunau's avatar Janne Grunau Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (11245): hdpvr: add struct v4l2_device

parent 0b61dca2
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -278,6 +278,13 @@ static int hdpvr_probe(struct usb_interface *interface,
		err("Out of memory");
		err("Out of memory");
		goto error;
		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->io_mutex);
	mutex_init(&dev->i2c_mutex);
	mutex_init(&dev->i2c_mutex);
	mutex_init(&dev->usbc_mutex);
	mutex_init(&dev->usbc_mutex);
@@ -387,6 +394,7 @@ static void hdpvr_disconnect(struct usb_interface *interface)
	/* prevent more I/O from starting and stop any ongoing */
	/* prevent more I/O from starting and stop any ongoing */
	mutex_lock(&dev->io_mutex);
	mutex_lock(&dev->io_mutex);
	dev->status = STATUS_DISCONNECTED;
	dev->status = STATUS_DISCONNECTED;
	v4l2_device_disconnect(&dev->v4l2_dev);
	video_unregister_device(dev->video_dev);
	video_unregister_device(dev->video_dev);
	wake_up_interruptible(&dev->wait_data);
	wake_up_interruptible(&dev->wait_data);
	wake_up_interruptible(&dev->wait_buffer);
	wake_up_interruptible(&dev->wait_buffer);
@@ -413,6 +421,7 @@ static void hdpvr_disconnect(struct usb_interface *interface)
	printk(KERN_INFO "Hauppauge HD PVR: device /dev/video%d disconnected\n",
	printk(KERN_INFO "Hauppauge HD PVR: device /dev/video%d disconnected\n",
	       minor);
	       minor);


	v4l2_device_unregister(&dev->v4l2_dev);
	kfree(dev->usbc_buf);
	kfree(dev->usbc_buf);
	kfree(dev);
	kfree(dev);
}
}
+4 −0
Original line number Original line Diff line number Diff line
@@ -15,6 +15,8 @@
#include <linux/workqueue.h>
#include <linux/workqueue.h>
#include <linux/videodev2.h>
#include <linux/videodev2.h>


#include <media/v4l2-device.h>

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


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