From: H Hartley Sweeten Date: Tue, 26 Aug 2014 00:55:48 +0000 (-0700) Subject: staging: comedi: comedi_pci: introduce comedi_pci_detach() X-Git-Tag: fixes-for-v3.18-merge-window~15^2~996 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aac307f9dd5ce1fe651140a036ab4b0a0571b54a;p=pandora-kernel.git 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed