Commit 1dd33ab8 authored by Bernd Porr's avatar Bernd Porr Committed by Greg Kroah-Hartman

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 <BerndPorr@f2s.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Cc: David Schleef <ds@schleef.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 6a9d7a21
...@@ -62,6 +62,9 @@ module_param(comedi_debug, int, 0644); ...@@ -62,6 +62,9 @@ module_param(comedi_debug, int, 0644);
int comedi_autoconfig = 1; int comedi_autoconfig = 1;
module_param(comedi_autoconfig, bool, 0444); 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 DEFINE_SPINLOCK(comedi_file_info_table_lock);
static struct comedi_device_file_info static struct comedi_device_file_info
*comedi_file_info_table[COMEDI_NUM_MINORS]; *comedi_file_info_table[COMEDI_NUM_MINORS];
...@@ -1896,7 +1899,7 @@ static void comedi_cleanup_legacy_minors(void) ...@@ -1896,7 +1899,7 @@ static void comedi_cleanup_legacy_minors(void)
{ {
unsigned i; 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); comedi_free_board_minor(i);
} }
...@@ -1936,7 +1939,7 @@ static int __init comedi_init(void) ...@@ -1936,7 +1939,7 @@ static int __init comedi_init(void)
comedi_proc_init(); comedi_proc_init();
/* create devices files for legacy/manual use */ /* 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; int minor;
minor = comedi_alloc_board_minor(NULL); minor = comedi_alloc_board_minor(NULL);
if (minor < 0) { if (minor < 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment