summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi/drivers/adv_pci_dio.c
diff options
context:
space:
mode:
authorH Hartley Sweeten2014-08-26 02:55:49 +0200
committerGreg Kroah-Hartman2014-08-30 22:24:54 +0200
commit6ab5db9ca63377904136dce678f0c42f09f1ce6d (patch)
tree534c37359d69a58115395fe30f8c0bb713e0c436 /drivers/staging/comedi/drivers/adv_pci_dio.c
parentstaging: comedi: comedi_pci: introduce comedi_pci_detach() (diff)
downloadkernel-qcow2-linux-6ab5db9ca63377904136dce678f0c42f09f1ce6d.tar.gz
kernel-qcow2-linux-6ab5db9ca63377904136dce678f0c42f09f1ce6d.tar.xz
kernel-qcow2-linux-6ab5db9ca63377904136dce678f0c42f09f1ce6d.zip
staging: comedi: adv_pci_dio: remove 'valid' member from private data
This member is set at the end of the driver attach and is only used to verify that pci_dio_reset() can be called in the (*detach). The only requirement for pci_dio_reset() to work is that the dev->iobase is valid. Remove the 'valid' member from the private data and use 'dev->iobase' to see if the reset can be done. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers/adv_pci_dio.c')
-rw-r--r--drivers/staging/comedi/drivers/adv_pci_dio.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/staging/comedi/drivers/adv_pci_dio.c b/drivers/staging/comedi/drivers/adv_pci_dio.c
index 8aab4949a96c..99c8ba7e3b8e 100644
--- a/drivers/staging/comedi/drivers/adv_pci_dio.c
+++ b/drivers/staging/comedi/drivers/adv_pci_dio.c
@@ -393,7 +393,6 @@ static const struct dio_boardtype boardtypes[] = {
};
struct pci_dio_private {
- char valid; /* card is usable */
char GlobalIrqEnabled; /* 1= any IRQ source is enabled */
/* PCI-1760 specific data */
unsigned char IDICntEnable; /* counter's counting enable status */
@@ -1155,8 +1154,6 @@ static int pci_dio_auto_attach(struct comedi_device *dev,
if (this_board->cardtype == TYPE_PCI1760)
pci1760_attach(dev);
- devpriv->valid = 1;
-
pci_dio_reset(dev);
return 0;
@@ -1164,12 +1161,8 @@ static int pci_dio_auto_attach(struct comedi_device *dev,
static void pci_dio_detach(struct comedi_device *dev)
{
- struct pci_dio_private *devpriv = dev->private;
-
- if (devpriv) {
- if (devpriv->valid)
- pci_dio_reset(dev);
- }
+ if (dev->iobase)
+ pci_dio_reset(dev);
comedi_pci_detach(dev);
}