Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 318060
b: refs/heads/master
c: 96554c8
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jul 19, 2012
1 parent 23c63c6 commit cfaa634
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dbe85f1757f1cb6a8ce206a38a855fb7b60ca159
refs/heads/master: 96554c81d512d171b2e3b9dd3769bed8280ded2f
42 changes: 27 additions & 15 deletions trunk/drivers/staging/comedi/drivers/adv_pci1710.c
Original file line number Diff line number Diff line change
Expand Up @@ -1333,29 +1333,21 @@ static int pci1710_reset(struct comedi_device *dev)
DPRINTK("adv_pci1710 EDBG: END: pci1710_reset(...)\n");
}

static int pci1710_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
static struct pci_dev *pci1710_find_pci_dev(struct comedi_device *dev,
struct comedi_devconfig *it)
{
struct comedi_subdevice *s;
int ret, subdev, n_subdevices;
unsigned int irq;
unsigned long iobase;
struct pci_dev *pcidev;
int opt_bus, opt_slot;
const char *errstr;
unsigned char pci_bus, pci_slot, pci_func;
int i;
int board_index;

dev_info(dev->class_dev, DRV_NAME ": attach\n");
unsigned int irq;
unsigned long iobase;

opt_bus = it->options[0];
opt_slot = it->options[1];

ret = alloc_private(dev, sizeof(struct pci1710_private));
if (ret < 0)
return -ENOMEM;

/* Look for matching PCI device */
errstr = "not found!";
pcidev = NULL;
Expand Down Expand Up @@ -1404,7 +1396,7 @@ static int pci1710_attach(struct comedi_device *dev,
} else {
dev_err(dev->class_dev, "- Card %s\n", errstr);
}
return -EIO;
return NULL;
}

pci_bus = pcidev->bus->number;
Expand All @@ -1416,10 +1408,30 @@ static int pci1710_attach(struct comedi_device *dev,
dev_dbg(dev->class_dev, "b:s:f=%d:%d:%d, io=0x%4lx\n",
pci_bus, pci_slot, pci_func, iobase);

dev->iobase = iobase;
return pcidev;
}

static int pci1710_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
struct comedi_subdevice *s;
int ret, subdev, n_subdevices;
unsigned int irq;

dev_info(dev->class_dev, DRV_NAME ": attach\n");

ret = alloc_private(dev, sizeof(struct pci1710_private));
if (ret < 0)
return -ENOMEM;

devpriv->pcidev = pci1710_find_pci_dev(dev, it);
if (!devpriv->pcidev)
return -EIO;

dev->iobase = pci_resource_start(devpriv->pcidev, 2);
irq = devpriv->pcidev->irq;

dev->board_name = this_board->name;
devpriv->pcidev = pcidev;

n_subdevices = 0;
if (this_board->n_aichan)
Expand Down

0 comments on commit cfaa634

Please sign in to comment.