struct pnp_dev *isapnp_dev = NULL;
int i;
- for (i = 0; i < n_ni_boards; i++) {
+ for (i = 0; i < ARRAY_SIZE(ni_boards); i++) {
isapnp_dev = pnp_find_dev(NULL,
ISAPNP_VENDOR('N', 'I', 'C'),
ISAPNP_FUNCTION(ni_boards[i].
}
break;
}
- if (i == n_ni_boards)
+ if (i == ARRAY_SIZE(ni_boards))
return -ENODEV;
*dev = isapnp_dev;
return 0;
int device_id = ni_read_eeprom(dev, 511);
int i;
- for (i = 0; i < n_ni_boards; i++) {
+ for (i = 0; i < ARRAY_SIZE(ni_boards); i++) {
if (ni_boards[i].device_id == device_id)
return i;
static int ni_atmio_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
+ const struct ni_board_struct *boardtype;
struct ni_private *devpriv;
struct pnp_dev *isapnp_dev;
int ret;
return -EIO;
dev->board_ptr = ni_boards + board;
+ boardtype = comedi_board(dev)
- printk(" %s", boardtype.name);
- dev->board_name = boardtype.name;
+ printk(" %s", boardtype->name);
+ dev->board_name = boardtype->name;
/* irq stuff */