aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2012-09-11 18:08:37 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-12 12:29:22 -0400
commit398e6f1230160e614ef0f878725cdd5f51fda8cd (patch)
tree54cb016f6d515e9e4bdd6c5ba6a7c0f75da61e14
parentf62608e3d01ecfc66e0d380dbd0a3927a1ca4b4f (diff)
staging: comedi: adv_pci1710: remove unnecessary 'valid'
The 'valid' variable in the private data is only used in the detach of the board to determine if the pci1710_reset() function can be called. That function only requires a valid dev->iobase to work. Use that for the check instead and remove the unneeded variable from the private data. 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/adv_pci1710.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/staging/comedi/drivers/adv_pci1710.c b/drivers/staging/comedi/drivers/adv_pci1710.c
index 571c22cae4a3..09fe373b9ab2 100644
--- a/drivers/staging/comedi/drivers/adv_pci1710.c
+++ b/drivers/staging/comedi/drivers/adv_pci1710.c
@@ -300,7 +300,6 @@ static const struct boardtype boardtypes[] = {
300}; 300};
301 301
302struct pci1710_private { 302struct pci1710_private {
303 char valid; /* card is usable */
304 char neverending_ai; /* we do unlimited AI */ 303 char neverending_ai; /* we do unlimited AI */
305 unsigned int CntrlReg; /* Control register */ 304 unsigned int CntrlReg; /* Control register */
306 unsigned int i8254_osc_base; /* frequence of onboard oscilator */ 305 unsigned int i8254_osc_base; /* frequence of onboard oscilator */
@@ -1433,8 +1432,6 @@ static int pci1710_attach_pci(struct comedi_device *dev,
1433 subdev++; 1432 subdev++;
1434 } 1433 }
1435 1434
1436 devpriv->valid = 1;
1437
1438 dev_info(dev->class_dev, "%s attached, irq %sabled\n", 1435 dev_info(dev->class_dev, "%s attached, irq %sabled\n",
1439 dev->board_name, dev->irq ? "en" : "dis"); 1436 dev->board_name, dev->irq ? "en" : "dis");
1440 1437
@@ -1443,15 +1440,12 @@ static int pci1710_attach_pci(struct comedi_device *dev,
1443 1440
1444static void pci1710_detach(struct comedi_device *dev) 1441static void pci1710_detach(struct comedi_device *dev)
1445{ 1442{
1446 struct pci1710_private *devpriv = dev->private;
1447 struct pci_dev *pcidev = comedi_to_pci_dev(dev); 1443 struct pci_dev *pcidev = comedi_to_pci_dev(dev);
1448 1444
1449 if (devpriv) { 1445 if (dev->iobase)
1450 if (devpriv->valid) 1446 pci1710_reset(dev);
1451 pci1710_reset(dev); 1447 if (dev->irq)
1452 if (dev->irq) 1448 free_irq(dev->irq, dev);
1453 free_irq(dev->irq, dev);
1454 }
1455 if (pcidev) { 1449 if (pcidev) {
1456 if (dev->iobase) 1450 if (dev->iobase)
1457 comedi_pci_disable(pcidev); 1451 comedi_pci_disable(pcidev);