[PATCH 16/17] staging: comedi: icp_multi: remove board reset during (*detach)

H Hartley Sweeten hsweeten at visionengravers.com
Wed Oct 7 21:52:48 UTC 2015


The icp_multi_reset() function currnelt does the following during the
(*auto_attach) and (*detach) of this driver:

  1) disables all interrupts and clears any pending requests
  2) resets the analog output channels to 0V (0..5V range)
  3) sets all digital output channels to 0

Interrupts are not used by this driver so the disable/clear when
detaching is not necessary.

Depending on the use, reseting the analog and digital outputs when the
driver is detached might not be desireable.

Remove the board reset during the (*detach) and use comedi_pci_detach()
directly.

Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
Cc: Ian Abbott <abbotti at mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
---
 drivers/staging/comedi/drivers/icp_multi.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/staging/comedi/drivers/icp_multi.c b/drivers/staging/comedi/drivers/icp_multi.c
index 17cf514..b76b594a 100644
--- a/drivers/staging/comedi/drivers/icp_multi.c
+++ b/drivers/staging/comedi/drivers/icp_multi.c
@@ -313,18 +313,11 @@ static int icp_multi_auto_attach(struct comedi_device *dev,
 	return 0;
 }
 
-static void icp_multi_detach(struct comedi_device *dev)
-{
-	if (dev->mmio)
-		icp_multi_reset(dev);
-	comedi_pci_detach(dev);
-}
-
 static struct comedi_driver icp_multi_driver = {
 	.driver_name	= "icp_multi",
 	.module		= THIS_MODULE,
 	.auto_attach	= icp_multi_auto_attach,
-	.detach		= icp_multi_detach,
+	.detach		= comedi_pci_detach,
 };
 
 static int icp_multi_pci_probe(struct pci_dev *dev,
-- 
2.5.1



More information about the devel mailing list