Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325526
b: refs/heads/master
c: 91e674e
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 26, 2012
1 parent ce8cf57 commit 8a023e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 42 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: 832defbb58061fedb7a5c43aab7d762afaac2cc9
refs/heads/master: 91e674e83c530d5902e482ede1af0115989c4fe6
45 changes: 4 additions & 41 deletions trunk/drivers/staging/comedi/drivers/s626.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ Authors: Gianluca Palli <gpalli@deis.unibo.it>,
Updated: Fri, 15 Feb 2008 10:28:42 +0000
Status: experimental
Configuration options:
[0] - PCI bus of device (optional)
[1] - PCI slot of device (optional)
If bus/slot is not specified, the first supported
PCI device found will be used.
Configuration options: not applicable, uses PCI auto config
INSN_CONFIG instructions:
analog input:
Expand Down Expand Up @@ -2442,35 +2438,7 @@ static void CountersInit(struct comedi_device *dev)
}
}

static struct pci_dev *s626_find_pci(struct comedi_device *dev,
struct comedi_devconfig *it)
{
struct pci_dev *pcidev = NULL;
int bus = it->options[0];
int slot = it->options[1];
int i;

do {
pcidev = pci_get_subsys(PCI_VENDOR_ID_S626,
PCI_DEVICE_ID_S626,
PCI_SUBVENDOR_ID_S626,
PCI_SUBDEVICE_ID_S626,
pcidev);

if ((bus || slot) && pcidev) {
/* matches requested bus/slot */
if (pcidev->bus->number == bus &&
PCI_SLOT(pcidev->devfn) == slot)
break;
} else {
break;
}
} while (1);

return pcidev;
}

static int s626_attach(struct comedi_device *dev, struct comedi_devconfig *it)
static int s626_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
{
/* uint8_t PollList; */
/* uint16_t AdcData; */
Expand All @@ -2487,11 +2455,7 @@ static int s626_attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (alloc_private(dev, sizeof(struct s626_private)) < 0)
return -ENOMEM;

devpriv->pdev = s626_find_pci(dev, it);
if (!devpriv->pdev) {
printk(KERN_ERR "s626_attach: Board not present!!!\n");
return -ENODEV;
}
devpriv->pdev = pcidev;

result = comedi_pci_enable(devpriv->pdev, "s626");
if (result < 0) {
Expand Down Expand Up @@ -2932,15 +2896,14 @@ static void s626_detach(struct comedi_device *dev)
if (devpriv->pdev) {
if (devpriv->got_regions)
comedi_pci_disable(devpriv->pdev);
pci_dev_put(devpriv->pdev);
}
}
}

static struct comedi_driver s626_driver = {
.driver_name = "s626",
.module = THIS_MODULE,
.attach = s626_attach,
.attach_pci = s626_attach_pci,
.detach = s626_detach,
};

Expand Down

0 comments on commit 8a023e1

Please sign in to comment.