]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: comedi: amplc_dio200: remove dio200_common_detach()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 12 Aug 2014 18:17:23 +0000 (11:17 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 16 Aug 2014 19:23:25 +0000 (12:23 -0700)
This exported function just does a free_irq() to release the interrupt
handler for the legacy and PCI dio200 drivers.

The legacy driver also calls comedi_legacy_detach() which would also
do the free_irq(). For that driver the just use comedi_legacy_detach()
directly for the (*detach).

For the PCI driver, add the free_irq() to the private (*datach) function.

Remove the, then unused, dio200_common_detach() function.

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>
drivers/staging/comedi/drivers/amplc_dio200.c
drivers/staging/comedi/drivers/amplc_dio200.h
drivers/staging/comedi/drivers/amplc_dio200_common.c
drivers/staging/comedi/drivers/amplc_dio200_pci.c

index 9b5efb7990a5048a212d47ea433ead132642dbfe..4fe118380218b479b1642a2fadb703c36db0f68a 100644 (file)
@@ -257,17 +257,11 @@ static int dio200_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        return amplc_dio200_common_attach(dev, it->options[1], 0);
 }
 
-static void dio200_detach(struct comedi_device *dev)
-{
-       amplc_dio200_common_detach(dev);
-       comedi_legacy_detach(dev);
-}
-
 static struct comedi_driver amplc_dio200_driver = {
        .driver_name    = "amplc_dio200",
        .module         = THIS_MODULE,
        .attach         = dio200_attach,
-       .detach         = dio200_detach,
+       .detach         = comedi_legacy_detach,
        .board_name     = &dio200_isa_boards[0].name,
        .offset         = sizeof(struct dio200_board),
        .num_names      = ARRAY_SIZE(dio200_isa_boards),
index d87539c34283c307f8666da34901b90880e6189a..d6d6a265c4610bda7cf02172f17402fbbe1e7a6c 100644 (file)
@@ -45,8 +45,6 @@ struct dio200_board {
 int amplc_dio200_common_attach(struct comedi_device *dev, unsigned int irq,
                               unsigned long req_irq_flags);
 
-void amplc_dio200_common_detach(struct comedi_device *dev);
-
 /* Used by initialization of PCIe boards. */
 void amplc_dio200_set_enhance(struct comedi_device *dev, unsigned char val);
 
index ba449029e16d6fa261aa30562394aaf545db4c34..87c01692d80022883f90eea45c0c1f7580d1c34c 100644 (file)
@@ -1055,15 +1055,6 @@ int amplc_dio200_common_attach(struct comedi_device *dev, unsigned int irq,
 }
 EXPORT_SYMBOL_GPL(amplc_dio200_common_attach);
 
-void amplc_dio200_common_detach(struct comedi_device *dev)
-{
-       if (dev->irq) {
-               free_irq(dev->irq, dev);
-               dev->irq = 0;
-       }
-}
-EXPORT_SYMBOL_GPL(amplc_dio200_common_detach);
-
 static int __init amplc_dio200_common_init(void)
 {
        return 0;
index 2dfdcaf3612c707acda302acbe31e73d414963e5..423b6249d4f12750689c6106f62ca9d1b21947db 100644 (file)
@@ -389,7 +389,8 @@ static int dio200_pci_auto_attach(struct comedi_device *dev,
 
 static void dio200_pci_detach(struct comedi_device *dev)
 {
-       amplc_dio200_common_detach(dev);
+       if (dev->irq)
+               free_irq(dev->irq, dev);
        if (dev->mmio)
                iounmap(dev->mmio);
        comedi_pci_disable(dev);