Introduce a new helper function, comedi_pci_detach(), that can be used as the (*detach) of a comedi PCI driver to handle the boilerplate code of the PCI driver detach. Use the the new helper to remove the boilerplate from most of the comedi PCI drivers. Some of the drivers need additional cleanup before comedi_pci_disable() can be removed. This series was orignally posted as a single patch: [PATCH] staging: comedi: comedi_pci: enhance comedi_pci_disable() Ian Abbott pointed out a couple issues and race conditions in that patch. This breaks the patch up and drops the patches that had race issues. v1: original single patch v2: split patch and addressed issues pointed out by Ian Abbott v3: drop patches with race conditions H Hartley Sweeten (7): staging: comedi: comedi_pci: introduce comedi_pci_detach() staging: comedi: adv_pci_dio: remove 'valid' member from private data staging: comedi: icp_multi: remove 'valid' member from private data staging: comedi: s626: tidy up freeing of the dma buffers staging: comedi: s626: use comedi_pci_detach() staging: comedi: cb_pcidas64: tidy up freeing of the dma buffers staging: comedi: gsc_hpdi: tidy up freeing of the dma buffers drivers/staging/comedi/comedi_pci.c | 24 ++++++ drivers/staging/comedi/comedidev.h | 5 ++ drivers/staging/comedi/drivers/8255_pci.c | 9 +-- .../staging/comedi/drivers/addi-data/addi_common.c | 12 +-- drivers/staging/comedi/drivers/addi_apci_1032.c | 4 +- drivers/staging/comedi/drivers/addi_apci_1516.c | 2 +- drivers/staging/comedi/drivers/addi_apci_1564.c | 4 +- drivers/staging/comedi/drivers/addi_apci_16xx.c | 2 +- drivers/staging/comedi/drivers/addi_apci_2032.c | 4 +- drivers/staging/comedi/drivers/addi_apci_2200.c | 2 +- drivers/staging/comedi/drivers/addi_apci_3120.c | 8 +- drivers/staging/comedi/drivers/addi_apci_3501.c | 4 +- drivers/staging/comedi/drivers/addi_apci_3xxx.c | 14 +--- drivers/staging/comedi/drivers/adl_pci6208.c | 2 +- drivers/staging/comedi/drivers/adl_pci7x3x.c | 2 +- drivers/staging/comedi/drivers/adl_pci8164.c | 2 +- drivers/staging/comedi/drivers/adl_pci9111.c | 4 +- drivers/staging/comedi/drivers/adl_pci9118.c | 8 +- drivers/staging/comedi/drivers/adv_pci1710.c | 4 +- drivers/staging/comedi/drivers/adv_pci1723.c | 2 +- drivers/staging/comedi/drivers/adv_pci1724.c | 2 +- drivers/staging/comedi/drivers/adv_pci_dio.c | 13 +--- drivers/staging/comedi/drivers/amplc_dio200_pci.c | 11 +-- drivers/staging/comedi/drivers/amplc_pci224.c | 4 +- drivers/staging/comedi/drivers/amplc_pci230.c | 4 +- drivers/staging/comedi/drivers/amplc_pci236.c | 9 +-- drivers/staging/comedi/drivers/amplc_pci263.c | 2 +- drivers/staging/comedi/drivers/cb_pcidas.c | 12 +-- drivers/staging/comedi/drivers/cb_pcidas64.c | 88 ++++++++++++---------- drivers/staging/comedi/drivers/cb_pcidda.c | 2 +- drivers/staging/comedi/drivers/cb_pcimdas.c | 9 +-- drivers/staging/comedi/drivers/cb_pcimdda.c | 2 +- drivers/staging/comedi/drivers/contec_pci_dio.c | 2 +- drivers/staging/comedi/drivers/daqboard2000.c | 12 +-- drivers/staging/comedi/drivers/das08_pci.c | 2 +- drivers/staging/comedi/drivers/dt3000.c | 11 +-- drivers/staging/comedi/drivers/dyna_pci10xx.c | 2 +- drivers/staging/comedi/drivers/gsc_hpdi.c | 45 ++++++----- drivers/staging/comedi/drivers/icp_multi.c | 14 +--- drivers/staging/comedi/drivers/ke_counter.c | 2 +- drivers/staging/comedi/drivers/me4000.c | 4 +- drivers/staging/comedi/drivers/me_daq.c | 6 +- drivers/staging/comedi/drivers/mf6x4.c | 15 ++-- drivers/staging/comedi/drivers/ni_6527.c | 6 +- drivers/staging/comedi/drivers/ni_65xx.c | 8 +- drivers/staging/comedi/drivers/ni_670x.c | 4 +- drivers/staging/comedi/drivers/ni_labpc_pci.c | 11 +-- drivers/staging/comedi/drivers/s626.c | 51 +++++-------- drivers/staging/comedi/drivers/skel.c | 2 +- 49 files changed, 192 insertions(+), 281 deletions(-) -- 2.0.3 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel