struct pcilst_struct *ptr_select_and_alloc_pci_card(unsigned short vendor_id,
unsigned short device_id,
unsigned short pci_bus,
- unsigned short pci_slot,
- int i_Master);
+ unsigned short pci_slot);
-int pci_card_alloc(struct pcilst_struct *amcc, int master);
int i_pci_card_free(struct pcilst_struct *amcc);
/****************************************************************************/
return 1;
}
-/****************************************************************************/
-/* mark card as used */
-int pci_card_alloc(struct pcilst_struct *amcc, int master)
-{
- if (!amcc)
- return -1;
-
- if (amcc->used)
- return 1;
- if (comedi_pci_enable(amcc->pcidev, "addi_amcc_s5933"))
- return -1;
- if (master)
- pci_set_master(amcc->pcidev);
- amcc->used = 1;
-
- return 0;
-}
-
/****************************************************************************/
/* mark card as free */
int i_pci_card_free(struct pcilst_struct *amcc)
struct pcilst_struct *ptr_select_and_alloc_pci_card(unsigned short vendor_id,
unsigned short device_id,
unsigned short pci_bus,
- unsigned short pci_slot,
- int i_Master)
+ unsigned short pci_slot)
{
struct pcilst_struct *card;
}
}
- if (pci_card_alloc(card, i_Master) != 0) {
- printk(" - Can't allocate card!\n");
- return NULL;
-
- }
-
return card;
}
#endif
card = ptr_select_and_alloc_pci_card(this_board->i_VendorId,
this_board->i_DeviceId,
it->options[0],
- it->options[1], i_Dma);
+ it->options[1]);
if (card == NULL)
return -EIO;
+ ret = comedi_pci_enable(card->pcidev, "addi_amcc_s5933");
+ if (ret)
+ return ret;
+ if (i_Dma)
+ pci_set_master(card->pcidev);
+ card->used = 1;
devpriv->allocated = 1;
iobase_a = pci_resource_start(card->pcidev, 0);