diff options
| author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-01-17 17:38:01 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-18 12:49:24 -0800 |
| commit | a0ba8a299049d3c997b69a7cee23a1432aac9417 (patch) | |
| tree | ee68512f5b0e9e35b99ca48383c1921a114d4eb5 | |
| parent | fb1e4e2e0b8a5b57ca861b6fc6d9f4af0bbb568e (diff) | |
staging: comedi: addi_apci_2200: simplify the PCI bar reading
The board supported by this driver has a 93x76 eeprom. Knowing this
information allows simplifying the code that reads the PCI bars to
get the iobase addresses.
Also, since the 'dw_AiBase' is not ioremap'ed we can remove the iounmap
in the detach.
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_2200.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/drivers/staging/comedi/drivers/addi_apci_2200.c b/drivers/staging/comedi/drivers/addi_apci_2200.c index 632013643085..49847ba5d3e9 100644 --- a/drivers/staging/comedi/drivers/addi_apci_2200.c +++ b/drivers/staging/comedi/drivers/addi_apci_2200.c @@ -90,24 +90,10 @@ static int apci2200_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 */ @@ -227,8 +213,6 @@ static void apci2200_detach(struct comedi_device *dev) apci2200_reset(dev); if (dev->irq) free_irq(dev->irq, dev); - if (devpriv->dw_AiBase) - iounmap(devpriv->dw_AiBase); } if (pcidev) { if (dev->iobase) |
