diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2014-08-25 17:55:48 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-08-30 13:24:54 -0700 |
commit | aac307f9dd5ce1fe651140a036ab4b0a0571b54a (patch) | |
tree | 28797d71317c989f4b10ecf517641959dfea7cdb /drivers/staging/comedi/drivers/adv_pci_dio.c | |
parent | staging: comedi: me4000: use comedi_subdevice 'readback' (diff) | |
download | linux-dev-aac307f9dd5ce1fe651140a036ab4b0a0571b54a.tar.xz linux-dev-aac307f9dd5ce1fe651140a036ab4b0a0571b54a.zip |
staging: comedi: comedi_pci: introduce comedi_pci_detach()
Introduce a generic (*detach) function for comedi PCI drivers to handle
the boilerplate code needed to detach a PCI driver.
This function works similar to comedi_legacy_detach() where it will:
* free the dev->irq if it has been requested
* iounmap the dev->mmio addres if it has been ioremap'ed
The helper then calls comedi_pci_disable() to release the regions and
disable the PCI device.
Use the new helper directly for the (*detach) in the following cases:
* where comedi_pci_disable() is used directly for the (*detach)
* where the detach function is just boilerplate
Use the new helper in the (*detach) of the simpler PCI drivers. Call
the helper after disabling interrupts (reset) and before any additional
cleanup (kfree) to avoid any race conditions with the interrupt handler.
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/comedi/drivers/adv_pci_dio.c b/drivers/staging/comedi/drivers/adv_pci_dio.c index f3e2268d4fee..8aab4949a96c 100644 --- a/drivers/staging/comedi/drivers/adv_pci_dio.c +++ b/drivers/staging/comedi/drivers/adv_pci_dio.c @@ -1170,7 +1170,7 @@ static void pci_dio_detach(struct comedi_device *dev) if (devpriv->valid) pci_dio_reset(dev); } - comedi_pci_disable(dev); + comedi_pci_detach(dev); } static struct comedi_driver adv_pci_dio_driver = { |