summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/uvc/uvc_driver.c
diff options
context:
space:
mode:
authorAlexey Fisher <bug-track@fisher-privat.net>2011-11-03 09:39:37 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-12-11 11:22:07 -0200
commitedbaa39842793fc4ac6603b277f2ad76f2057a45 (patch)
tree6a7a2213fb36540587a8dc77953efa3dcc6ba812 /drivers/media/video/uvc/uvc_driver.c
parentc4d99f89e20c87c8e2a992ce4cf9aa4325dc7fa7 (diff)
[media] uvcvideo: Add debugfs support
Create a debugfs entry per UVC stream. This will be used to export stream statistics. Signed-off-by: Alexey Fisher <bug-track@fisher-privat.net> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [mchehab@redhat.com: add incude <linux/module.h> to avoid compilation breakage] Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc/uvc_driver.c')
-rw-r--r--drivers/media/video/uvc/uvc_driver.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/media/video/uvc/uvc_driver.c b/drivers/media/video/uvc/uvc_driver.c
index 750ab689b99..a240d43d15d 100644
--- a/drivers/media/video/uvc/uvc_driver.c
+++ b/drivers/media/video/uvc/uvc_driver.c
@@ -1675,6 +1675,8 @@ static void uvc_unregister_video(struct uvc_device *dev)
video_unregister_device(stream->vdev);
stream->vdev = NULL;
+
+ uvc_debugfs_cleanup_stream(stream);
}
/* Decrement the stream count and call uvc_delete explicitly if there
@@ -1700,6 +1702,8 @@ static int uvc_register_video(struct uvc_device *dev,
return ret;
}
+ uvc_debugfs_init_stream(stream);
+
/* Register the device with V4L. */
vdev = video_device_alloc();
if (vdev == NULL) {
@@ -2405,17 +2409,24 @@ struct uvc_driver uvc_driver = {
static int __init uvc_init(void)
{
- int result;
+ int ret;
- result = usb_register(&uvc_driver.driver);
- if (result == 0)
- printk(KERN_INFO DRIVER_DESC " (" DRIVER_VERSION ")\n");
- return result;
+ uvc_debugfs_init();
+
+ ret = usb_register(&uvc_driver.driver);
+ if (ret < 0) {
+ uvc_debugfs_cleanup();
+ return ret;
+ }
+
+ printk(KERN_INFO DRIVER_DESC " (" DRIVER_VERSION ")\n");
+ return 0;
}
static void __exit uvc_cleanup(void)
{
usb_deregister(&uvc_driver.driver);
+ uvc_debugfs_cleanup();
}
module_init(uvc_init);