Add a module parameter 'comedi_autoconfig'. Set it to 0 or 'N' to disable
authorIan Abbott <abbotti@mev.co.uk>
Mon, 8 Dec 2008 17:05:50 +0000 (17:05 +0000)
committerIan Abbott <abbotti@mev.co.uk>
Mon, 8 Dec 2008 17:05:50 +0000 (17:05 +0000)
autoconfiguration.  It is enabled by default.

comedi/comedi_fops.c
comedi/comedi_fops.h
comedi/drivers.c

index db95178380be0171e497445bf2ae6680a0369509..9ac73dde9deefabb8bba6669ba676a6f72fadfa9 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 08a57128d0983ca61eb07be5ad8a9ecc0b76bb06..ef7c5cc3d06cb5f49df7160cc2c412dfa28065fd 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 40195b02f809ffd8633975edb4f7f4cba7f1bd61..b5059a823059c377f4a43660305ffe44333744f6 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);