{"p16r16dio", P16R16DIO_SIZE,},
};
-#define n_boardtypes (sizeof(boardtypes)/sizeof(struct boardtype))
#define this_board ((const struct boardtype *)dev->board_ptr)
static struct comedi_driver driver_acl7225b = {
.attach = acl7225b_attach,
.detach = acl7225b_detach,
.board_name = &boardtypes[0].name,
- .num_names = n_boardtypes,
+ .num_names = ARRAY_SIZE(boardtypes),
.offset = sizeof(struct boardtype),
};
#endif
};
-#define n_boardtypes (sizeof(boardtypes)/sizeof(struct addi_board))
-
static struct comedi_driver driver_addi = {
.driver_name = ADDIDATA_DRIVER_NAME,
.module = THIS_MODULE,
.attach = i_ADDI_Attach,
.detach = i_ADDI_Detach,
- .num_names = n_boardtypes,
+ .num_names = ARRAY_SIZE(boardtypes),
.board_name = &boardtypes[0].pc_DriverName,
.offset = sizeof(struct addi_board),
};
10000, 40, 512},
};
-#define n_boardtypes (sizeof(boardtypes)/sizeof(struct boardtype))
-
static struct comedi_driver driver_pci9118 = {
.driver_name = "adl_pci9118",
.module = THIS_MODULE,
.attach = pci9118_attach,
.detach = pci9118_detach,
- .num_names = n_boardtypes,
+ .num_names = ARRAY_SIZE(boardtypes),
.board_name = &boardtypes[0].name,
.offset = sizeof(struct boardtype),
};
{.name = DRV_NAME},
};
-#define n_boardtypes (sizeof(boardtypes)/sizeof(struct boardtype))
-
static struct comedi_driver driver_pci1710 = {
.driver_name = DRV_NAME,
.module = THIS_MODULE,
.attach = pci1710_attach,
.detach = pci1710_detach,
- .num_names = n_boardtypes,
+ .num_names = ARRAY_SIZE(boardtypes),
.board_name = &boardtypes[0].name,
.offset = sizeof(struct boardtype),
};
while (NULL != (pcidev = pci_get_device(PCI_VENDOR_ID_ADVANTECH,
PCI_ANY_ID, pcidev))) {
if (strcmp(this_board->name, DRV_NAME) == 0) {
- for (i = 0; i < n_boardtypes; ++i) {
+ for (i = 0; i < ARRAY_SIZE(boardtypes); ++i) {
if (pcidev->device == boardtypes[i].device_id) {
board_index = i;
break;
}
}
- if (i == n_boardtypes)
+ if (i == ARRAY_SIZE(boardtypes))
continue;
} else {
if (pcidev->device != boardtypes[board_index].device_id)
struct comedi_devconfig *it);
static int pci1723_detach(struct comedi_device *dev);
-#define n_boardtypes (sizeof(boardtypes)/sizeof(struct pci1723_board))
-
static struct comedi_driver driver_pci1723 = {
.driver_name = "adv_pci1723",
.module = THIS_MODULE,
IO_16b}
};
-#define n_boardtypes (sizeof(boardtypes)/sizeof(struct dio_boardtype))
-
static struct comedi_driver driver_pci_dio = {
.driver_name = "adv_pci_dio",
.module = THIS_MODULE,
for_each_pci_dev(pcidev) {
/* loop through cards supported by this driver */
- for (i = 0; i < n_boardtypes; ++i) {
+ for (i = 0; i < ARRAY_SIZE(boardtypes); ++i) {
if (boardtypes[i].vendor_id != pcidev->vendor)
continue;
if (boardtypes[i].device_id != pcidev->device)
{"ids4", DAQBOARD2000_SUBSYSTEM_IDS4},
};
-#define n_boardtypes (sizeof(boardtypes)/sizeof(struct daq200_boardtype))
#define this_board ((const struct daq200_boardtype *)dev->board_ptr)
static DEFINE_PCI_DEVICE_TABLE(daqboard2000_pci_table) = {
devpriv->pci_dev = card;
id = ((u32) card->
subsystem_device << 16) | card->subsystem_vendor;
- for (i = 0; i < n_boardtypes; i++) {
+ for (i = 0; i < ARRAY_SIZE(boardtypes); i++) {
if (boardtypes[i].id == id) {
dev_dbg(dev->hw_dev, "%s\n",
boardtypes[i].name);
},
};
-#define n_boardtypes (sizeof(boardtypes)/sizeof(struct dt282x_board))
#define this_board ((const struct dt282x_board *)dev->board_ptr)
struct dt282x_private {
.attach = dt282x_attach,
.detach = dt282x_detach,
.board_name = &boardtypes[0].name,
- .num_names = n_boardtypes,
+ .num_names = ARRAY_SIZE(boardtypes),
.offset = sizeof(struct dt282x_board),
};
&range_analog}, /* Rangelist for D/A */
};
-#define n_boardtypes (sizeof(boardtypes)/sizeof(struct boardtype))
-
static struct comedi_driver driver_icp_multi = {
.driver_name = "icp_multi",
.module = THIS_MODULE,
.attach = icp_multi_attach,
.detach = icp_multi_detach,
- .num_names = n_boardtypes,
+ .num_names = ARRAY_SIZE(boardtypes),
.board_name = &boardtypes[0].name,
.offset = sizeof(struct boardtype),
};
{"acl8112dg", 0, 1, 1, 9, 16, 2, 15, &range_acl8112dg_ai},
};
-#define n_boardtypes (sizeof(boardtypes)/sizeof(struct pcl711_board))
#define this_board ((const struct pcl711_board *)dev->board_ptr)
static int pcl711_attach(struct comedi_device *dev,
.attach = pcl711_attach,
.detach = pcl711_detach,
.board_name = &boardtypes[0].name,
- .num_names = n_boardtypes,
+ .num_names = ARRAY_SIZE(boardtypes),
.offset = sizeof(struct pcl711_board),
};
{"pet48dio", 48, 2, 0x9eb8, PET48_SIZE, 0, 1,},
};
-#define n_boardtypes (sizeof(boardtypes)/sizeof(struct pcl724_board))
#define this_board ((const struct pcl724_board *)dev->board_ptr)
static struct comedi_driver driver_pcl724 = {
.attach = pcl724_attach,
.detach = pcl724_detach,
.board_name = &boardtypes[0].name,
- .num_names = n_boardtypes,
+ .num_names = ARRAY_SIZE(boardtypes),
.offset = sizeof(struct pcl724_board),
};
&rangelist_728[0],},
};
-#define n_boardtypes (sizeof(boardtypes)/sizeof(struct pcl726_board))
#define this_board ((const struct pcl726_board *)dev->board_ptr)
static struct comedi_driver driver_pcl726 = {
.attach = pcl726_attach,
.detach = pcl726_detach,
.board_name = &boardtypes[0].name,
- .num_names = n_boardtypes,
+ .num_names = ARRAY_SIZE(boardtypes),
.offset = sizeof(struct pcl726_board),
};
{"acl7130", ACL7130_SIZE,},
};
-#define n_boardtypes (sizeof(boardtypes)/sizeof(struct pcl730_board))
#define this_board ((const struct pcl730_board *)dev->board_ptr)
static struct comedi_driver driver_pcl730 = {
.attach = pcl730_attach,
.detach = pcl730_detach,
.board_name = &boardtypes[0].name,
- .num_names = n_boardtypes,
+ .num_names = ARRAY_SIZE(boardtypes),
.offset = sizeof(struct pcl730_board),
};
0xdcfc, 0x0a, PCLx1x_IORANGE, 0},
};
-#define n_boardtypes (sizeof(boardtypes)/sizeof(struct pcl812_board))
#define this_board ((const struct pcl812_board *)dev->board_ptr)
static struct comedi_driver driver_pcl812 = {
.attach = pcl812_attach,
.detach = pcl812_detach,
.board_name = &boardtypes[0].name,
- .num_names = n_boardtypes,
+ .num_names = ARRAY_SIZE(boardtypes),
.offset = sizeof(struct pcl812_board),
};
100},
};
-#define n_boardtypes (sizeof(boardtypes)/sizeof(struct pcl816_board))
#define devpriv ((struct pcl816_private *)dev->private)
#define this_board ((const struct pcl816_board *)dev->board_ptr)
.attach = pcl816_attach,
.detach = pcl816_detach,
.board_name = &boardtypes[0].name,
- .num_names = n_boardtypes,
+ .num_names = ARRAY_SIZE(boardtypes),
.offset = sizeof(struct pcl816_board),
};
0x0a, 0xfff, 0xfff, 0, 1 /* XXX ? */ },
};
-#define n_boardtypes (sizeof(boardtypes)/sizeof(struct pcl818_board))
-
static struct comedi_driver driver_pcl818 = {
.driver_name = "pcl818",
.module = THIS_MODULE,
.attach = pcl818_attach,
.detach = pcl818_detach,
.board_name = &boardtypes[0].name,
- .num_names = n_boardtypes,
+ .num_names = ARRAY_SIZE(boardtypes),
.offset = sizeof(struct pcl818_board),
};
{"pcm3724", 48, 2, 0x00fc, PCM3724_SIZE,},
};
-#define n_boardtypes (sizeof(boardtypes)/sizeof(struct pcm3724_board))
#define this_board ((const struct pcm3724_board *)dev->board_ptr)
static struct comedi_driver driver_pcm3724 = {
.attach = pcm3724_attach,
.detach = pcm3724_detach,
.board_name = &boardtypes[0].name,
- .num_names = n_boardtypes,
+ .num_names = ARRAY_SIZE(boardtypes),
.offset = sizeof(struct pcm3724_board),
};