enum dio200_layout layout;
};
-#define IS_ISA_BOARD(board) (DO_ISA && (board)->bustype == isa_bustype)
-#define IS_PCI_BOARD(board) (DO_PCI && (board)->bustype == pci_bustype)
-
static const struct dio200_board dio200_boards[] = {
#if DO_ISA
{
int continuous;
};
+static inline bool is_pci_board(const struct dio200_board *board)
+{
+ return DO_PCI && board->bustype == pci_bustype;
+}
+
+static inline bool is_isa_board(const struct dio200_board *board)
+{
+ return DO_ISA && board->bustype == isa_bustype;
+}
+
/*
* This function looks for a board matching the supplied PCI device.
*/
unsigned int i;
for (i = 0; i < ARRAY_SIZE(dio200_boards); i++)
- if (dio200_boards[i].bustype == pci_bustype &&
+ if (is_pci_board(&dio200_boards[i]) &&
pci_dev->device == dio200_boards[i].devid)
return &dio200_boards[i];
return NULL;
char tmpbuf[60];
int tmplen;
- if (IS_ISA_BOARD(thisboard))
+ if (is_isa_board(thisboard))
tmplen = scnprintf(tmpbuf, sizeof(tmpbuf),
"(base %#lx) ", dev->iobase);
- else if (IS_PCI_BOARD(thisboard))
+ else if (is_pci_board(thisboard))
tmplen = scnprintf(tmpbuf, sizeof(tmpbuf),
"(pci %s) ", pci_name(pcidev));
else
}
/* Process options and reserve resources according to bus type. */
- if (IS_ISA_BOARD(thisboard)) {
+ if (is_isa_board(thisboard)) {
unsigned long iobase;
unsigned int irq;
if (ret < 0)
return ret;
return dio200_common_attach(dev, iobase, irq, 0);
- } else if (IS_PCI_BOARD(thisboard)) {
+ } else if (is_pci_board(thisboard)) {
struct pci_dev *pci_dev;
pci_dev = dio200_find_pci_dev(dev, it);
}
}
}
- if (IS_ISA_BOARD(thisboard)) {
+ if (is_isa_board(thisboard)) {
if (dev->iobase)
release_region(dev->iobase, DIO200_IO_SIZE);
- } else if (IS_PCI_BOARD(thisboard)) {
+ } else if (is_pci_board(thisboard)) {
struct pci_dev *pcidev = comedi_to_pci_dev(dev);
if (pcidev) {
if (dev->iobase)