[PATCH 04/16] staging: comedi: amplc_dio200: remove dio200_detach()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This exported function only does a free_irq() for the dio200 legacy and
PCI drivers. The ISA driver also calls comedi_legacy_detach() which
would also do the free_irq().

Remove the exported function and use comedi_legacy_detach() directly
in the legacy driver for the (*detach).

Add the free_irq() to the PCI drivers (*detach).

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/amplc_dio200.c        | 8 +-------
 drivers/staging/comedi/drivers/amplc_dio200.h        | 2 --
 drivers/staging/comedi/drivers/amplc_dio200_common.c | 9 ---------
 drivers/staging/comedi/drivers/amplc_dio200_pci.c    | 3 ++-
 4 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_dio200.c b/drivers/staging/comedi/drivers/amplc_dio200.c
index 17d2e20..19b5c40 100644
--- a/drivers/staging/comedi/drivers/amplc_dio200.c
+++ b/drivers/staging/comedi/drivers/amplc_dio200.c
@@ -282,17 +282,11 @@ static int dio200_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	return amplc_dio200_common_attach(dev, irq, 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),
diff --git a/drivers/staging/comedi/drivers/amplc_dio200.h b/drivers/staging/comedi/drivers/amplc_dio200.h
index e0afe2c..641f1bf 100644
--- a/drivers/staging/comedi/drivers/amplc_dio200.h
+++ b/drivers/staging/comedi/drivers/amplc_dio200.h
@@ -69,8 +69,6 @@ struct dio200_private {
 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);
 
diff --git a/drivers/staging/comedi/drivers/amplc_dio200_common.c b/drivers/staging/comedi/drivers/amplc_dio200_common.c
index f0d709e..81b082b 100644
--- a/drivers/staging/comedi/drivers/amplc_dio200_common.c
+++ b/drivers/staging/comedi/drivers/amplc_dio200_common.c
@@ -1193,15 +1193,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;
diff --git a/drivers/staging/comedi/drivers/amplc_dio200_pci.c b/drivers/staging/comedi/drivers/amplc_dio200_pci.c
index fbf0568..7480304 100644
--- a/drivers/staging/comedi/drivers/amplc_dio200_pci.c
+++ b/drivers/staging/comedi/drivers/amplc_dio200_pci.c
@@ -412,7 +412,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);
-- 
2.0.3

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux