summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2012-10-24 15:47:49 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-24 22:25:11 (GMT)
commitdba949a1a0839d324642d99bce90052964125b45 (patch)
treef17c545b51f3e50eaade765b2c453f24f187139f
parent8e17cfbaa0b6ffa839028661327a17020cc53d2d (diff)
downloadlinux-fsl-qoriq-dba949a1a0839d324642d99bce90052964125b45.tar.xz
staging: comedi: amplc_dio200: absorb dio200_pci_common_attach()
Absorb `dio200_pci_common_attach()` into `dio200_attach_pci()` since that's the only place it is called from. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/comedi/drivers/amplc_dio200.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/drivers/staging/comedi/drivers/amplc_dio200.c b/drivers/staging/comedi/drivers/amplc_dio200.c
index 2c39dc5..0cc6e11 100644
--- a/drivers/staging/comedi/drivers/amplc_dio200.c
+++ b/drivers/staging/comedi/drivers/amplc_dio200.c
@@ -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
@@ -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;
@@ -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)