Skip to content

Commit

Permalink
Staging: comedi: add comedi_num_legacy_minors module parameter
Browse files Browse the repository at this point in the history
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: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Bernd Porr authored and Greg Kroah-Hartman committed Apr 3, 2009
1 parent 6a9d7a2 commit 1dd33ab
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/staging/comedi/comedi_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 1dd33ab

Please sign in to comment.