aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/hdpvr/hdpvr-core.c
diff options
context:
space:
mode:
authorJanne Grunau <j@jannau.net>2009-03-27 19:01:40 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:43:43 -0400
commit06630aec92d6a71658ac1538e2a65af5cfc5f2af (patch)
treea765950e5ad32466fee4585c2e9bf3766951a118 /drivers/media/video/hdpvr/hdpvr-core.c
parent0b61dca28909bc548581bec75e3b90faaa7f11fd (diff)
V4L/DVB (11245): hdpvr: add struct v4l2_device
Signed-off-by: Janne Grunau <j@jannau.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/hdpvr/hdpvr-core.c')
-rw-r--r--drivers/media/video/hdpvr/hdpvr-core.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/video/hdpvr/hdpvr-core.c b/drivers/media/video/hdpvr/hdpvr-core.c
index 547833eb6cec..3b19a259dc4e 100644
--- a/drivers/media/video/hdpvr/hdpvr-core.c
+++ b/drivers/media/video/hdpvr/hdpvr-core.c
@@ -278,6 +278,13 @@ static int hdpvr_probe(struct usb_interface *interface,
278 err("Out of memory"); 278 err("Out of memory");
279 goto error; 279 goto error;
280 } 280 }
281
282 /* register v4l2_device early so it can be used for printks */
283 if (v4l2_device_register(&interface->dev, &dev->v4l2_dev)) {
284 err("v4l2_device_register failed");
285 goto error;
286 }
287
281 mutex_init(&dev->io_mutex); 288 mutex_init(&dev->io_mutex);
282 mutex_init(&dev->i2c_mutex); 289 mutex_init(&dev->i2c_mutex);
283 mutex_init(&dev->usbc_mutex); 290 mutex_init(&dev->usbc_mutex);
@@ -387,6 +394,7 @@ static void hdpvr_disconnect(struct usb_interface *interface)
387 /* prevent more I/O from starting and stop any ongoing */ 394 /* prevent more I/O from starting and stop any ongoing */
388 mutex_lock(&dev->io_mutex); 395 mutex_lock(&dev->io_mutex);
389 dev->status = STATUS_DISCONNECTED; 396 dev->status = STATUS_DISCONNECTED;
397 v4l2_device_disconnect(&dev->v4l2_dev);
390 video_unregister_device(dev->video_dev); 398 video_unregister_device(dev->video_dev);
391 wake_up_interruptible(&dev->wait_data); 399 wake_up_interruptible(&dev->wait_data);
392 wake_up_interruptible(&dev->wait_buffer); 400 wake_up_interruptible(&dev->wait_buffer);
@@ -413,6 +421,7 @@ static void hdpvr_disconnect(struct usb_interface *interface)
413 printk(KERN_INFO "Hauppauge HD PVR: device /dev/video%d disconnected\n", 421 printk(KERN_INFO "Hauppauge HD PVR: device /dev/video%d disconnected\n",
414 minor); 422 minor);
415 423
424 v4l2_device_unregister(&dev->v4l2_dev);
416 kfree(dev->usbc_buf); 425 kfree(dev->usbc_buf);
417 kfree(dev); 426 kfree(dev);
418} 427}