staging: comedi: addi_apci_1032: simplify the PCI bar reading

This change “staging: comedi: addi_apci_1032: simplify the PCI bar reading” (commit 05f22ad) in Linux kernel is authored by H Hartley Sweeten <hartleys [at] visionengravers.com> on Mon Nov 5 14:36:53 2012 -0700.

Description of "staging: comedi: addi_apci_1032: simplify the PCI bar reading"

The change “staging: comedi: addi_apci_1032: simplify the PCI bar reading” introduces changes as follows.

staging: comedi: addi_apci_1032: simplify the PCI bar reading

This board has a 93c76 eeprom. Knowing this information allows
simplifying the code that reads the PCI bars to get the iobase
addresses used in the driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Linux kernel releases containing commit 05f22ad

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "staging: comedi: addi_apci_1032: simplify the PCI bar reading"

There are 20 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 .../staging/comedi/drivers/addi_apci_1032.c   | 20 ++++---------------
 1 file changed, 4 insertions(+), 16 deletions(-)
 
diff --git a/drivers/staging/comedi/drivers/addi_apci_1032.c b/drivers/staging/comedi/drivers/addi_apci_1032.c
index 70cada42dd1b..8ea9feac4e27 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1032.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1032.c
@@ -88,22 +88,10 @@ static int apci1032_attach_pci(struct comedi_device *dev,
 	if (ret)
 		return ret;
 
-	if (!this_board->pc_EepromChip ||
-	    !strcmp(this_board->pc_EepromChip, 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 {
-		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, 2);
+	devpriv->iobase = pci_resource_start(pcidev, 2);
+	devpriv->dw_AiBase = ioremap(pci_resource_start(pcidev, 3),
+				     this_board->i_IorangeBase3);
 	devpriv->i_IobaseReserved = pci_resource_start(pcidev, 3);
 
 	/* Initialize parameters that can be overridden in EEPROM */

The commit for this change in Linux stable tree is 05f22ad (patch).

Last modified: 2020/02/10