From patchwork Tue Feb 14 21:15:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Petter Selasky X-Patchwork-Id: 9884 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1RxPpo-0002hW-PV for patchwork@linuxtv.org; Tue, 14 Feb 2012 22:22:48 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtp for id 1RxPpo-0002Jm-A3; Tue, 14 Feb 2012 22:22:48 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757213Ab2BNVWp (ORCPT ); Tue, 14 Feb 2012 16:22:45 -0500 Received: from mailfe05.c2i.net ([212.247.154.130]:51985 "EHLO swip.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755364Ab2BNVWp (ORCPT ); Tue, 14 Feb 2012 16:22:45 -0500 X-Greylist: delayed 300 seconds by postgrey-1.27 at vger.kernel.org; Tue, 14 Feb 2012 16:22:44 EST X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [176.74.208.111] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe05.swip.net (CommuniGate Pro SMTP 5.4.2) with ESMTPA id 237339976 for linux-media@vger.kernel.org; Tue, 14 Feb 2012 22:17:42 +0100 From: Hans Petter Selasky To: "linux-media" Subject: [PATCH] Make the USB Video Class debug filesystem support compile time optional. Date: Tue, 14 Feb 2012 22:15:51 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) X-Face: 'mmZ:T{)),Oru^0c+/}w'`gU1$ubmG?lp!=R4Wy\ELYo2)@'UZ24N@ =?utf-8?q?d2+AyewRX=7DmAm=3BYp=0A=09=7CU=5B?=@, _z/([?1bCfM{_"B<.J>mICJCHAzzGHI{y7{%JVz%R~yJHIji`y> =?utf-8?q?Y=7Dk1C4TfysrsUI=0A=09-=25GU9V5=5DiUZF=26nRn9mJ=27=3F=26?=>O MIME-Version: 1.0 Message-Id: <201202142215.51388.hselasky@c2i.net> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.2.14.211218 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, FROM_NAME_PHRASE 0, __ANY_URI 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __URI_NO_WWW 0, __URI_NS , __USER_AGENT 0' The following patch makes the recently added DEBUGFS for UVC optional. --HPS Signed-off-by: Hans Petter Selasky --- drivers/media/video/uvc/Kconfig | 9 +++++++++ drivers/media/video/uvc/Makefile | 5 ++++- drivers/media/video/uvc/uvc_driver.c | 12 ++++++++++-- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/media/video/uvc/Kconfig b/drivers/media/video/uvc/Kconfig index 6c197da..45e89a9 100644 --- a/drivers/media/video/uvc/Kconfig +++ b/drivers/media/video/uvc/Kconfig @@ -7,6 +7,15 @@ config USB_VIDEO_CLASS For more information see: +config USB_VIDEO_CLASS_DEBUGFS + bool "UVC debugfs support" + default y + ---help--- + This option makes the USB Video Class driver build with + debugfs support. + + If you are in doubt, say Y. + config USB_VIDEO_CLASS_INPUT_EVDEV bool "UVC input events device support" default y diff --git a/drivers/media/video/uvc/Makefile b/drivers/media/video/uvc/Makefile index c26d12f..a152a2a 100644 --- a/drivers/media/video/uvc/Makefile +++ b/drivers/media/video/uvc/Makefile @@ -1,5 +1,8 @@ uvcvideo-objs := uvc_driver.o uvc_queue.o uvc_v4l2.o uvc_video.o uvc_ctrl.o \ - uvc_status.o uvc_isight.o uvc_debugfs.o + uvc_status.o uvc_isight.o +ifeq ($(CONFIG_USB_VIDEO_CLASS_DEBUGFS),y) +uvcvideo-objs += uvc_debugfs.o +endif ifeq ($(CONFIG_MEDIA_CONTROLLER),y) uvcvideo-objs += uvc_entity.o endif diff --git a/drivers/media/video/uvc/uvc_driver.c b/drivers/media/video/uvc/uvc_driver.c index a240d43..291f77b 100644 --- a/drivers/media/video/uvc/uvc_driver.c +++ b/drivers/media/video/uvc/uvc_driver.c @@ -1676,7 +1676,9 @@ static void uvc_unregister_video(struct uvc_device *dev) video_unregister_device(stream->vdev); stream->vdev = NULL; +#ifdef CONFIG_USB_VIDEO_CLASS_DEBUGFS uvc_debugfs_cleanup_stream(stream); +#endif } /* Decrement the stream count and call uvc_delete explicitly if there @@ -1702,8 +1704,9 @@ static int uvc_register_video(struct uvc_device *dev, return ret; } +#ifdef CONFIG_USB_VIDEO_CLASS_DEBUGFS uvc_debugfs_init_stream(stream); - +#endif /* Register the device with V4L. */ vdev = video_device_alloc(); if (vdev == NULL) { @@ -2411,11 +2414,14 @@ static int __init uvc_init(void) { int ret; +#ifdef CONFIG_USB_VIDEO_CLASS_DEBUGFS uvc_debugfs_init(); - +#endif ret = usb_register(&uvc_driver.driver); if (ret < 0) { +#ifdef CONFIG_USB_VIDEO_CLASS_DEBUGFS uvc_debugfs_cleanup(); +#endif return ret; } @@ -2426,7 +2432,9 @@ static int __init uvc_init(void) static void __exit uvc_cleanup(void) { usb_deregister(&uvc_driver.driver); +#ifdef CONFIG_USB_VIDEO_CLASS_DEBUGFS uvc_debugfs_cleanup(); +#endif } module_init(uvc_init);