summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2012-11-13 13:41:41 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-13 15:12:47 -0800
commita3003b41331c83b0be7c46126ed4f03cc22bee05 (patch)
treef86150cec12d76a9dee4f2656b62fd8dd9f80971
parent56587a06ade1f95f1425cc5fb2230fb54e82428f (diff)
staging: comedi: addi_apci_1516: simplify the PCI bar reading
The boards supported by this driver have an eeprom attached to a S5920 PCI controller chip. Knowing this information allows simplifying the code that reads the PCI bars to get the iobase address. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/comedi/drivers/addi_apci_1516.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/drivers/staging/comedi/drivers/addi_apci_1516.c b/drivers/staging/comedi/drivers/addi_apci_1516.c
index 8fc848b021be..5d114864b85e 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1516.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1516.c
@@ -99,24 +99,10 @@ static int __devinit apci1516_auto_attach(struct comedi_device *dev,
if (ret)
return ret;
- if (!this_board->pc_EepromChip ||
- strcmp(this_board->pc_EepromChip, ADDIDATA_9054)) {
- /* board does not have an eeprom or is not ADDIDATA_9054 */
- if (this_board->i_IorangeBase1)
- dev->iobase = pci_resource_start(pcidev, 1);
- else
- dev->iobase = pci_resource_start(pcidev, 0);
-
- devpriv->iobase = dev->iobase;
- devpriv->i_IobaseAmcc = pci_resource_start(pcidev, 0);
- devpriv->i_IobaseAddon = pci_resource_start(pcidev, 2);
- } else {
- /* board has an ADDIDATA_9054 eeprom */
- dev->iobase = pci_resource_start(pcidev, 2);
- devpriv->iobase = pci_resource_start(pcidev, 2);
- devpriv->dw_AiBase = ioremap(pci_resource_start(pcidev, 3),
- this_board->i_IorangeBase3);
- }
+ dev->iobase = pci_resource_start(pcidev, 1);
+ devpriv->iobase = dev->iobase;
+ devpriv->i_IobaseAmcc = pci_resource_start(pcidev, 0);
+ devpriv->i_IobaseAddon = pci_resource_start(pcidev, 2);
devpriv->i_IobaseReserved = pci_resource_start(pcidev, 3);
/* Initialize parameters that can be overridden in EEPROM */