int hw_err_mask)
{
const struct pci9118_boardinfo *board = comedi_board(dev);
- struct pci9118_private *devpriv = dev->private;
struct pci_dev *pcidev = comedi_to_pci_dev(dev);
+ struct pci9118_private *devpriv;
struct comedi_subdevice *s;
int ret, pages, i;
u16 u16w;
+ devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
+ if (!devpriv)
+ return -ENOMEM;
+
ret = comedi_pci_enable(dev);
if (ret)
return ret;
static int pci9118_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
- struct pci9118_private *devpriv;
struct pci_dev *pcidev;
int ext_mux, disable_irq, master, softsshdelay, hw_err_mask;
softsshdelay = it->options[4];
hw_err_mask = it->options[5];
- devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
- if (!devpriv)
- return -ENOMEM;
-
pcidev = pci9118_find_pci(dev, it);
if (!pcidev)
return -EIO;
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);
const struct pci9118_boardinfo *board = NULL;
- struct pci9118_private *devpriv;
if (context < ARRAY_SIZE(pci9118_boards))
board = &pci9118_boards[context];
dev->board_ptr = board;
dev->board_name = board->name;
- devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
- if (!devpriv)
- return -ENOMEM;
-
/*
* Need to 'get' the PCI device to match the 'put' in pci9118_detach().
* (The 'put' also matches the implicit 'get' by pci9118_find_pci().)