[PATCH 10/21] staging: comedi: das08: Remove pci_iobase from private data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The `pci_iobase` I/O port registers from PCI BAR 1 are never accessed,
so don't bother storing this base address in `struct
das08_private_struct`.

The `pci_iobase` member was checked for non-zero in `das08_detach()` but
we can check `dev->iobase` is non-zero instead.

Signed-off-by: Ian Abbott <abbotti@xxxxxxxxx>
---
 drivers/staging/comedi/drivers/das08.c | 8 ++------
 drivers/staging/comedi/drivers/das08.h | 1 -
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index 396e2b6..e6ee9d8 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -749,7 +749,6 @@ static int das08_pci_attach_common(struct comedi_device *dev,
 				   struct pci_dev *pdev)
 {
 	unsigned long iobase;
-	unsigned long pci_iobase;
 	struct das08_private_struct *devpriv = dev->private;
 
 	if (!IS_ENABLED(CONFIG_COMEDI_DAS08_PCI))
@@ -763,11 +762,8 @@ static int das08_pci_attach_common(struct comedi_device *dev,
 		return -EIO;
 	}
 	/*  read base addresses */
-	pci_iobase = pci_resource_start(pdev, 1);
 	iobase = pci_resource_start(pdev, 2);
-	dev_info(dev->class_dev, "pcibase 0x%lx  iobase 0x%lx\n",
-		 pci_iobase, iobase);
-	devpriv->pci_iobase = pci_iobase;
+	dev_info(dev->class_dev, "iobase 0x%lx\n", iobase);
 	return das08_common_attach(dev, iobase);
 }
 
@@ -907,7 +903,7 @@ static void __maybe_unused das08_detach(struct comedi_device *dev)
 	} else if (IS_ENABLED(CONFIG_COMEDI_DAS08_PCI) &&
 		   thisboard->bustype == pci) {
 		if (devpriv && devpriv->pdev) {
-			if (devpriv->pci_iobase)
+			if (dev->iobase)
 				comedi_pci_disable(devpriv->pdev);
 			pci_dev_put(devpriv->pdev);
 		}
diff --git a/drivers/staging/comedi/drivers/das08.h b/drivers/staging/comedi/drivers/das08.h
index 48fa183..af3024e 100644
--- a/drivers/staging/comedi/drivers/das08.h
+++ b/drivers/staging/comedi/drivers/das08.h
@@ -52,7 +52,6 @@ struct das08_private_struct {
 	unsigned int do_bits;	/*  bits for do register on boards with register dedicated to digital out only */
 	const unsigned int *pg_gainlist;
 	struct pci_dev *pdev;	/*  struct for pci-das08 */
-	unsigned int pci_iobase;	/*  additional base address for pci-das08 */
 	unsigned int i8254_iobase;
 };
 
-- 
1.7.12

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux