staging: comedi: addi_common.c: remove i_ADDI_Detach()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 14 Oct 2014 17:44:17 +0000 (10:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2014 07:48:53 +0000 (15:48 +0800)
The addi_apci_035 and addi_apci_1500 are the only drivers left that use
this function in addi_common.c. Remove the function an add a private
comedi_driver (*detach) function to those drivers.

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/addi-data/addi_common.c
drivers/staging/comedi/drivers/addi_apci_035.c
drivers/staging/comedi/drivers/addi_apci_1500.c

index 2e7fb218340fe1adec31accb3423ca59284f93c9..51574a8d027ac94fbdc364ff0f1c52834b9ee6ce 100644 (file)
@@ -265,10 +265,3 @@ static int addi_auto_attach(struct comedi_device *dev,
        i_ADDI_Reset(dev);
        return 0;
 }
-
-static void i_ADDI_Detach(struct comedi_device *dev)
-{
-       if (dev->iobase)
-               i_ADDI_Reset(dev);
-       comedi_pci_detach(dev);
-}
index af70c84018806eb8325b20957dcd3131f9f33702..b06fde1d6c398176d475f3e0f8479bd7e3ecc344 100644 (file)
@@ -45,11 +45,18 @@ static int apci035_auto_attach(struct comedi_device *dev,
        return addi_auto_attach(dev, context);
 }
 
+static void apci035_detach(struct comedi_device *dev)
+{
+       if (dev->iobase)
+               i_ADDI_Reset(dev);
+       comedi_pci_detach(dev);
+}
+
 static struct comedi_driver apci035_driver = {
        .driver_name    = "addi_apci_035",
        .module         = THIS_MODULE,
        .auto_attach    = apci035_auto_attach,
-       .detach         = i_ADDI_Detach,
+       .detach         = apci035_detach,
 };
 
 static int apci035_pci_probe(struct pci_dev *dev,
index b7a284ac66498f921b328a99aee9745cb9b4d949..50a147fc38bfa856549b236db073b06d6b95c957 100644 (file)
@@ -44,11 +44,18 @@ static int apci1500_auto_attach(struct comedi_device *dev,
        return addi_auto_attach(dev, context);
 }
 
+static void apci1500_detach(struct comedi_device *dev)
+{
+       if (dev->iobase)
+               i_ADDI_Reset(dev);
+       comedi_pci_detach(dev);
+}
+
 static struct comedi_driver apci1500_driver = {
        .driver_name    = "addi_apci_1500",
        .module         = THIS_MODULE,
        .auto_attach    = apci1500_auto_attach,
-       .detach         = i_ADDI_Detach,
+       .detach         = apci1500_detach,
 };
 
 static int apci1500_pci_probe(struct pci_dev *dev,