From 6a9d7a21d710e544df20266b83b7829d9f7a1020 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Mon, 8 Dec 2008 17:05:50 +0000 Subject: [PATCH] Staging: comedi: Add a module parameter 'comedi_autoconfig'. Set it to 0 or 'N' to disable autoconfiguration. It is enabled by default. From: Ian Abbott Cc: Frank Mori Hess Cc: David Schleef Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/comedi_fops.c | 3 +++ drivers/staging/comedi/comedi_fops.h | 1 + drivers/staging/comedi/drivers.c | 3 +++ 3 files changed, 7 insertions(+) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 018c964396df..682e648ff3dd 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -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]; diff --git a/drivers/staging/comedi/comedi_fops.h b/drivers/staging/comedi/comedi_fops.h index 63f8df558e85..cb503c88c7f4 100644 --- a/drivers/staging/comedi/comedi_fops.h +++ b/drivers/staging/comedi/comedi_fops.h @@ -4,5 +4,6 @@ extern struct class *comedi_class; extern const struct file_operations comedi_fops; +extern int comedi_autoconfig; #endif /* _COMEDI_FOPS_H */ diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c index 36a93b95e3f2..5579aa0a9331 100644 --- a/drivers/staging/comedi/drivers.c +++ b/drivers/staging/comedi/drivers.c @@ -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); -- 2.20.1