Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 337223
b: refs/heads/master
c: dba949a
h: refs/heads/master
i:
  337221: 464547f
  337219: 5ecd0bb
  337215: cf01e63
v: v3
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Oct 24, 2012
1 parent c15bd6f commit 91e941b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 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: 8e17cfbaa0b6ffa839028661327a17020cc53d2d
refs/heads/master: dba949a1a0839d324642d99bce90052964125b45
27 changes: 10 additions & 17 deletions trunk/drivers/staging/comedi/drivers/amplc_dio200.c
Original file line number Diff line number Diff line change
Expand Up @@ -1253,22 +1253,6 @@ static int dio200_common_attach(struct comedi_device *dev, unsigned long iobase,
return 1;
}

static int dio200_pci_common_attach(struct comedi_device *dev,
struct pci_dev *pci_dev)
{
unsigned long iobase;
int ret;

ret = comedi_pci_enable(pci_dev, DIO200_DRIVER_NAME);
if (ret < 0) {
dev_err(dev->class_dev,
"error! cannot enable PCI device and request regions!\n");
return ret;
}
iobase = pci_resource_start(pci_dev, 2);
return dio200_common_attach(dev, iobase, pci_dev->irq, IRQF_SHARED);
}

/*
* Attach is called by the Comedi core to configure the driver
* for a particular board. If you specified a board_name array
Expand Down Expand Up @@ -1320,6 +1304,8 @@ static int __devinit dio200_attach_pci(struct comedi_device *dev,
struct pci_dev *pci_dev)
{
struct dio200_private *devpriv;
unsigned long iobase;
int ret;

if (!DO_PCI)
return -EINVAL;
Expand All @@ -1337,7 +1323,14 @@ static int __devinit dio200_attach_pci(struct comedi_device *dev,
dev_err(dev->class_dev, "BUG! cannot determine board type!\n");
return -EINVAL;
}
return dio200_pci_common_attach(dev, pci_dev);
ret = comedi_pci_enable(pci_dev, DIO200_DRIVER_NAME);
if (ret < 0) {
dev_err(dev->class_dev,
"error! cannot enable PCI device and request regions!\n");
return ret;
}
iobase = pci_resource_start(pci_dev, 2);
return dio200_common_attach(dev, iobase, pci_dev->irq, IRQF_SHARED);
}

static void dio200_detach(struct comedi_device *dev)
Expand Down

0 comments on commit 91e941b

Please sign in to comment.