aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2012-09-24 16:23:07 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-26 12:37:30 -0400
commit58f4a8fce1d6f1e42543376c85839576992e6100 (patch)
tree2b80c4ccdfd4d47ddb4d8b10825d875d4895fe39
parent41f821d07729d1c3d59d1ebebf4c57e2ffe0a37c (diff)
staging: comedi: s626: remove 'got_regions' from private data
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@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/s626.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c
index 93e55c314598..12709b0bbba1 100644
--- a/drivers/staging/comedi/drivers/s626.c
+++ b/drivers/staging/comedi/drivers/s626.c
@@ -80,7 +80,6 @@ INSN_CONFIG instructions:
80 80
81struct s626_private { 81struct s626_private {
82 void __iomem *base_addr; 82 void __iomem *base_addr;
83 int got_regions;
84 short allocatedBuf; 83 short allocatedBuf;
85 uint8_t ai_cmd_running; /* ai_cmd is running */ 84 uint8_t ai_cmd_running; /* ai_cmd is running */
86 uint8_t ai_continous; /* continous acquisition */ 85 uint8_t ai_continous; /* continous acquisition */
@@ -2460,7 +2459,7 @@ static int s626_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
2460 ret = comedi_pci_enable(pcidev, dev->board_name); 2459 ret = comedi_pci_enable(pcidev, dev->board_name);
2461 if (ret) 2460 if (ret)
2462 return ret; 2461 return ret;
2463 devpriv->got_regions = 1; 2462 dev->iobase = 1; /* detach needs this */
2464 2463
2465 resourceStart = pci_resource_start(pcidev, 0); 2464 resourceStart = pci_resource_start(pcidev, 0);
2466 2465
@@ -2512,7 +2511,6 @@ static int s626_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
2512 if (ret) 2511 if (ret)
2513 return ret; 2512 return ret;
2514 2513
2515 dev->iobase = (unsigned long)devpriv->base_addr;
2516 dev->irq = pcidev->irq; 2514 dev->irq = pcidev->irq;
2517 2515
2518 /* set up interrupt handler */ 2516 /* set up interrupt handler */
@@ -2893,7 +2891,7 @@ static void s626_detach(struct comedi_device *dev)
2893 iounmap(devpriv->base_addr); 2891 iounmap(devpriv->base_addr);
2894 } 2892 }
2895 if (pcidev) { 2893 if (pcidev) {
2896 if (devpriv->got_regions) 2894 if (dev->iobase)
2897 comedi_pci_disable(pcidev); 2895 comedi_pci_disable(pcidev);
2898 } 2896 }
2899} 2897}