staging: comedi: dyna_pci10xx: fix detach

The detach for this driver is missing the check to make sure
that the pci device is enabled before disabling it.

It's also missing the pci_dev_put().

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>
This commit is contained in:
H Hartley Sweeten 2012-07-18 19:01:34 -07:00 committed by Greg Kroah-Hartman
parent 06183026d8
commit f2a64902e3
1 changed files with 3 additions and 1 deletions

View File

@ -346,7 +346,9 @@ static void dyna_pci10xx_detach(struct comedi_device *dev)
if (devpriv)
mutex_destroy(&devpriv->mutex);
if (pcidev) {
comedi_pci_disable(pcidev);
if (dev->iobase)
comedi_pci_disable(pcidev);
pci_dev_put(pcidev);
}
}