fixed _attach() using local variable for board number
authorDavid Schleef <ds@schleef.org>
Sat, 12 Feb 2000 02:26:20 +0000 (02:26 +0000)
committerDavid Schleef <ds@schleef.org>
Sat, 12 Feb 2000 02:26:20 +0000 (02:26 +0000)
comedi/drivers/das1600.c

index 7a92a624e635f282519b0f3c7b61136e5c33f229..6f8881f94167d7e4411fa09b7b6a1186b368e56d 100644 (file)
@@ -325,12 +325,17 @@ static int das1600_attach(comedi_device * dev, comedi_devconfig * it)
        request_region(dev->iobase, DAS1600_BASE_SIZE, "das1600");
        request_region(dev->iobase + 0x400, DAS1600_DIO_SIZE, "das1600");
 
-       if (board == card_1601_12) {
-               dev->board_name = "das1601/12";
-       } else if (board == card_1602_12) {
-               dev->board_name = "das1602/12";
-       } else if (board == card_1602_16) {
-               dev->board_name = "das1602/16";
+       switch(dev->board){
+               case card_1601_12:
+               default:
+                       dev->board_name = "das1601/12";
+                       break;
+               case card_1602_12:
+                       dev->board_name = "das1601/12";
+                       break;
+               case card_1602_16:
+                       dev->board_name = "das1602/16";
+                       break;
        }
 
        dev->n_subdevices=5;