From 1dd33ab8a9397793d65b9fc090174ff7cdfaff95 Mon Sep 17 00:00:00 2001 From: Bernd Porr Date: Mon, 8 Dec 2008 23:30:13 +0000 Subject: [PATCH] Staging: comedi: add comedi_num_legacy_minors module parameter As suggested the legacy device count is set to zero. A new module parameter for comedi_fops allows setting the number of legacy devices: comedi_num_legacy_minors. The default is zero. From: Bernd Porr Cc: Ian Abbott Cc: Frank Mori Hess Cc: David Schleef Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/comedi_fops.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 682e648ff3dd..bacfa2b4b229 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -62,6 +62,9 @@ module_param(comedi_debug, int, 0644); int comedi_autoconfig = 1; module_param(comedi_autoconfig, bool, 0444); +int comedi_num_legacy_minors = 0; +module_param(comedi_num_legacy_minors, int, 0444); + static DEFINE_SPINLOCK(comedi_file_info_table_lock); static struct comedi_device_file_info *comedi_file_info_table[COMEDI_NUM_MINORS]; @@ -1896,7 +1899,7 @@ static void comedi_cleanup_legacy_minors(void) { unsigned i; - for (i = 0; i < COMEDI_NUM_LEGACY_MINORS; i++) + for (i = 0; i < comedi_num_legacy_minors; i++) comedi_free_board_minor(i); } @@ -1936,7 +1939,7 @@ static int __init comedi_init(void) comedi_proc_init(); /* create devices files for legacy/manual use */ - for (i = 0; i < COMEDI_NUM_LEGACY_MINORS; i++) { + for (i = 0; i < comedi_num_legacy_minors; i++) { int minor; minor = comedi_alloc_board_minor(NULL); if (minor < 0) { -- 2.20.1