summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/pvrusb2/pvrusb2-main.c
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2006-03-30 22:14:40 -0600
committerMike Isely <isely@pobox.com>2006-03-30 22:14:40 -0600
commit376fb9365c967e7d2bb2aee61e01685595bf1111 (patch)
tree31e740bc4607c2fc0fc0b904e7365939eb761761 /linux/drivers/media/video/pvrusb2/pvrusb2-main.c
parentdf9faeeb73f7e2d40d144d32b07dbc8560b5e031 (diff)
downloadmediapointer-dvb-s2-376fb9365c967e7d2bb2aee61e01685595bf1111.tar.gz
mediapointer-dvb-s2-376fb9365c967e7d2bb2aee61e01685595bf1111.tar.bz2
Make parts of pvrusb2 compile-time options (sysfs and debugifc)
From: Mike Isely <isely@pobox.com> Arrange things in pvrusb2 so that the sysfs-using component doesn't have to be compiled in. Control this with new CONFIG_VIDEO_PVRUSB2_SYSFS variable. This will allow the driver to still be used even if sysfs has not been compiled into the kernel. Also arrange things similarly in pvrusb2 for the debug interface, which is something that normally should not need to be built but is valuable for bug chasing. This is controlled now with CONFIG_VIDEO_PVRUSB2_DEBUGIFC. Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers/media/video/pvrusb2/pvrusb2-main.c')
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-main.c b/linux/drivers/media/video/pvrusb2/pvrusb2-main.c
index c070fc195..40fb6ae41 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-main.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-main.c
@@ -35,7 +35,9 @@
#include "pvrusb2-context.h"
#include "pvrusb2-debug.h"
#include "pvrusb2-v4l2.h"
+#ifdef CONFIG_VIDEO_PVRUSB2_SYSFS
#include "pvrusb2-sysfs.h"
+#endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */
#define DRIVER_AUTHOR "Mike Isely <isely@pobox.com>"
#define DRIVER_DESC "Hauppauge WinTV-PVR-USB2 MPEG2 Encoder/Tuner"
@@ -60,13 +62,17 @@ int pvrusb2_debug = DEFAULT_DEBUG_MASK;
module_param_named(debug,pvrusb2_debug,int,S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(debug, "Debug trace mask");
+#ifdef CONFIG_VIDEO_PVRUSB2_SYSFS
static struct pvr2_sysfs_class *class_ptr = 0;
+#endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */
static void pvr_setup_attach(struct pvr2_context *pvr)
{
/* Create association with v4l layer */
pvr2_v4l2_create(pvr);
+#ifdef CONFIG_VIDEO_PVRUSB2_SYSFS
pvr2_sysfs_create(pvr,class_ptr);
+#endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */
}
static int pvr_probe(struct usb_interface *intf,
@@ -138,7 +144,9 @@ static int __init pvr_init(void)
request_module("tda9887");
request_module("wm8775");
+#ifdef CONFIG_VIDEO_PVRUSB2_SYSFS
class_ptr = pvr2_sysfs_class_create();
+#endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */
ret = usb_register(&pvr_driver);
@@ -155,7 +163,9 @@ static void __exit pvr_exit(void)
pvr2_trace(PVR2_TRACE_INIT,"pvr_exit");
+#ifdef CONFIG_VIDEO_PVRUSB2_SYSFS
pvr2_sysfs_class_destroy(class_ptr);
+#endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */
usb_deregister(&pvr_driver);
}