[PATCH 06/20] staging: comedi: s626: remove 'got_regions' from private data

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

 



This variable is only used as a flag to indicate that the pci device
has been enabled and needs to be disabled in the detach. Use the
comedi_device 'iobase' for this and remove the private data variable.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/s626.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c
index 93e55c3..12709b0 100644
--- a/drivers/staging/comedi/drivers/s626.c
+++ b/drivers/staging/comedi/drivers/s626.c
@@ -80,7 +80,6 @@ INSN_CONFIG instructions:
 
 struct s626_private {
 	void __iomem *base_addr;
-	int got_regions;
 	short allocatedBuf;
 	uint8_t ai_cmd_running;	/*  ai_cmd is running */
 	uint8_t ai_continous;	/*  continous acquisition */
@@ -2460,7 +2459,7 @@ static int s626_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
 	ret = comedi_pci_enable(pcidev, dev->board_name);
 	if (ret)
 		return ret;
-	devpriv->got_regions = 1;
+	dev->iobase = 1;	/* detach needs this */
 
 	resourceStart = pci_resource_start(pcidev, 0);
 
@@ -2512,7 +2511,6 @@ static int s626_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
 	if (ret)
 		return ret;
 
-	dev->iobase = (unsigned long)devpriv->base_addr;
 	dev->irq = pcidev->irq;
 
 	/* set up interrupt handler */
@@ -2893,7 +2891,7 @@ static void s626_detach(struct comedi_device *dev)
 			iounmap(devpriv->base_addr);
 	}
 	if (pcidev) {
-		if (devpriv->got_regions)
+		if (dev->iobase)
 			comedi_pci_disable(pcidev);
 	}
 }
-- 
1.7.11

_______________________________________________
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