From a826a021f732fdaf525ba51d8810c13e558c9732 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Wed, 28 Feb 2001 18:00:16 +0000 Subject: [PATCH] changed comedi_driver member num_boards to num_names as this is more accurate --- comedi/drivers.c | 14 +++++++------- comedi/drivers/das800.c | 4 ++-- comedi/drivers/skel.c | 4 ++-- include/linux/comedidev.h | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/comedi/drivers.c b/comedi/drivers.c index 2363c358..2c731af0 100644 --- a/comedi/drivers.c +++ b/comedi/drivers.c @@ -111,7 +111,7 @@ int comedi_device_attach(comedi_device *dev,comedi_devconfig *it) dev->use_count = use_count; for(driv=comedi_drivers;driv;driv=driv->next){ - if(driv->register_boards && driv->num_boards){ + if(driv->register_boards && driv->num_names){ i=comedi_recognize(driv, it->board_name); if(i < 0) continue; }else if(driv->recognize){ @@ -176,16 +176,16 @@ int comedi_driver_register(comedi_driver *driver) driver->next=comedi_drivers; comedi_drivers=driver; - if(driver->register_boards && driver->num_boards) + if(driver->register_boards && driver->num_names) { - driver->board_name = kmalloc(driver->num_boards * sizeof(char*), GFP_KERNEL); + driver->board_name = kmalloc(driver->num_names * sizeof(char*), GFP_KERNEL); if(driver->board_name == NULL) { printk(KERN_ERR "comedi: memory allocation failure.\n"); ret = -ENOMEM; goto cleanup; } - driver->board_id = kmalloc(driver->num_boards * sizeof(int), GFP_KERNEL); + driver->board_id = kmalloc(driver->num_names * sizeof(int), GFP_KERNEL); if(driver->board_id == NULL) { printk(KERN_ERR "comedi: memory allocation failure.\n"); @@ -367,7 +367,7 @@ int comedi_recognize(comedi_driver *driv, const char *name) { unsigned int i = 0; - for(i = 0; i < driv->num_boards; i++) + for(i = 0; i < driv->num_names; i++) { if(strcmp(driv->board_name[i], name) == 0) return driv->board_id[i]; @@ -380,10 +380,10 @@ void comedi_report_boards(comedi_driver *driv) { unsigned int i; - if(driv->num_boards == 0) return; + if(driv->num_names == 0) return; printk("comedi: valid board names for %s driver are:\n", driv->driver_name); - for(i = 0; i < driv->num_boards; i++) + for(i = 0; i < driv->num_names; i++) { printk(" %s\n", driv->board_name[i]); } diff --git a/comedi/drivers/das800.c b/comedi/drivers/das800.c index c16f67a8..259afc70 100644 --- a/comedi/drivers/das800.c +++ b/comedi/drivers/das800.c @@ -223,7 +223,7 @@ comedi_driver driver_das800={ detach: das800_detach, recognize: das800_recognize, register_boards: das800_register_boards, - num_boards: sizeof(das800_boards) / sizeof(das800_board), + num_names: sizeof(das800_boards) / sizeof(das800_board), }; static void das800_interrupt(int irq, void *d, struct pt_regs *regs); @@ -244,7 +244,7 @@ static void das800_register_boards(void) { unsigned int i; - for(i = 0; i < driver_das800.num_boards; i++) + for(i = 0; i < driver_das800.num_names; i++) { driver_das800.board_name[i] = das800_boards[i].name; driver_das800.board_id[i] = i; diff --git a/comedi/drivers/skel.c b/comedi/drivers/skel.c index 17054090..00e67019 100644 --- a/comedi/drivers/skel.c +++ b/comedi/drivers/skel.c @@ -109,7 +109,7 @@ comedi_driver driver_skel={ /* comedi uses num_boards to allocate the board_name and board_id members * of this struct */ - num_boards: sizeof(skel_boards) / sizeof(skel_board), + num_names: sizeof(skel_boards) / sizeof(skel_board), }; static int skel_ai_rinsn(comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,lsampl_t *data); @@ -150,7 +150,7 @@ static void skel_register_boards(void) { unsigned int i; - for(i = 0; i < driver_skel.num_boards; i++) + for(i = 0; i < driver_skel.num_names; i++) { driver_skel.board_name[i] = skel_boards[i].name; driver_skel.board_id[i] = i; diff --git a/include/linux/comedidev.h b/include/linux/comedidev.h index 02f1769c..eaca056a 100644 --- a/include/linux/comedidev.h +++ b/include/linux/comedidev.h @@ -163,7 +163,7 @@ struct comedi_driver_struct{ */ void (*register_boards)(void); // initializes board_name and board_id arrays // number of elements in board_name and board_id arrays - unsigned int num_boards; + unsigned int num_names; /* board_name and board_id arrays are allocated by comedi_driver_register() * using the value of num_boards for the number of elements */ -- 2.26.2