Staging: comedi: Add a module parameter 'comedi_autoconfig'.
authorIan Abbott <abbotti@mev.co.uk>
Mon, 8 Dec 2008 17:05:50 +0000 (17:05 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 3 Apr 2009 21:53:51 +0000 (14:53 -0700)
Set it to 0 or 'N' to disable autoconfiguration.
It is enabled by default.

From: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Cc: David Schleef <ds@schleef.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/comedi/comedi_fops.c
drivers/staging/comedi/comedi_fops.h
drivers/staging/comedi/drivers.c

index 018c964396dfdd941e66070393b1bdfe059b6341..682e648ff3dda1b0f451c27c1ee53eaae2cd1269 100644 (file)
@@ -59,6 +59,9 @@ int comedi_debug;
 module_param(comedi_debug, int, 0644);
 #endif
 
+int comedi_autoconfig = 1;
+module_param(comedi_autoconfig, bool, 0444);
+
 static DEFINE_SPINLOCK(comedi_file_info_table_lock);
 static struct comedi_device_file_info
     *comedi_file_info_table[COMEDI_NUM_MINORS];
index 63f8df558e850faa889882fd8c4e430dd43abd55..cb503c88c7f40984de46daa1f82d902c65f152d2 100644 (file)
@@ -4,5 +4,6 @@
 
 extern struct class *comedi_class;
 extern const struct file_operations comedi_fops;
+extern int comedi_autoconfig;
 
 #endif /* _COMEDI_FOPS_H */
index 36a93b95e3f24027c55cb01d2dd8da5b641dd0cb..5579aa0a933194865d658d4d4b257b3639b23d0c 100644 (file)
@@ -797,6 +797,9 @@ int comedi_auto_config(struct device *hardware_device, const char *board_name, c
        struct comedi_device_file_info *dev_file_info;
        int retval;
 
+       if (!comedi_autoconfig)
+               return -ENODEV;
+
        minor = comedi_alloc_board_minor(hardware_device);
        if(minor < 0) return minor;
        dev_set_drvdata(hardware_device, (void*)(unsigned long)minor);