Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 318082
b: refs/heads/master
c: eeff9db
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jul 19, 2012
1 parent 2969813 commit cf1cfab
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 29 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: c5866e7850e015b984aae4ad56998f6ced69af8e
refs/heads/master: eeff9dbc6f7513b88163253b782b7e5a4b087cdd
57 changes: 29 additions & 28 deletions trunk/drivers/staging/comedi/drivers/cb_pcidas64.c
Original file line number Diff line number Diff line change
Expand Up @@ -1650,26 +1650,11 @@ static inline void warn_external_queue(struct comedi_device *dev)
"Use internal AI channel queue (channels must be consecutive and use same range/aref)");
}

/*
* Attach is called by the Comedi core to configure the driver
* for a particular board.
*/
static int attach(struct comedi_device *dev, struct comedi_devconfig *it)
static struct pci_dev *cb_pcidas64_find_pci_dev(struct comedi_device *dev,
struct comedi_devconfig *it)
{
struct pci_dev *pcidev = NULL;
int index;
uint32_t local_range, local_decode;
int retval;

/*
* Allocate the private structure area.
*/
if (alloc_private(dev, sizeof(struct pcidas64_private)) < 0)
return -ENOMEM;

/*
* Probe the device to determine what device in the series it is.
*/

for_each_pci_dev(pcidev) {
/* is it not a computer boards card? */
Expand All @@ -1687,22 +1672,38 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it)
continue;
}
}
priv(dev)->hw_dev = pcidev;
dev->board_ptr = pcidas64_boards + index;
break;
dev_dbg(dev->class_dev, "Found %s on bus %i, slot %i\n",
board(dev)->name,
pcidev->bus->number, PCI_SLOT(pcidev->devfn));
return pcidev;
}
if (dev->board_ptr)
break;
}

if (dev->board_ptr == NULL) {
printk
("No supported ComputerBoards/MeasurementComputing card found\n");
return -EIO;
}
printk("No supported ComputerBoards/MeasurementComputing card found\n");
return NULL;
}

/*
* Attach is called by the Comedi core to configure the driver
* for a particular board.
*/
static int attach(struct comedi_device *dev, struct comedi_devconfig *it)
{
struct pci_dev *pcidev;
uint32_t local_range, local_decode;
int retval;

dev_dbg(dev->class_dev, "Found %s on bus %i, slot %i\n",
board(dev)->name, pcidev->bus->number, PCI_SLOT(pcidev->devfn));
/*
* Allocate the private structure area.
*/
if (alloc_private(dev, sizeof(struct pcidas64_private)) < 0)
return -ENOMEM;

pcidev = cb_pcidas64_find_pci_dev(dev, it);
if (!pcidev)
return -EIO;
priv(dev)->hw_dev = pcidev;

if (comedi_pci_enable(pcidev, dev->driver->driver_name)) {
dev_warn(dev->class_dev,
Expand Down

0 comments on commit cf1cfab

Please sign in to comment.