From: H Hartley Sweeten Date: Fri, 13 Nov 2015 18:11:06 +0000 (-0700) Subject: staging: comedi: adv_pci1710: don't "reset" board when detaching X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=19cbb8fb798f9e391df2876ea9522fbd6be88358;p=openwrt%2Fstaging%2Fblogic.git staging: comedi: adv_pci1710: don't "reset" board when detaching Currently this driver calls pci1710_reset() during the (*detach) of the driver. That function does the following: 1) program the control register to stop any operations 2) clears the analog input FIFO 3) clears any pending interrupts 4) sets all the analog output channels to unipolar 5V range and 0V output 5) sets all the digital outputs to 0V Before detaching the comedi core will (*cancel) any running async commands. This will handle 1-3 above. Depending on the application, it might not be safe to reset the analog and digital outputs when the driver is detached. Remove the board reset when detaching and just use comedi_pci_detach() directly for the driver (*detach). Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/adv_pci1710.c b/drivers/staging/comedi/drivers/adv_pci1710.c index 62f9f478421c..e6d9db865d3b 100644 --- a/drivers/staging/comedi/drivers/adv_pci1710.c +++ b/drivers/staging/comedi/drivers/adv_pci1710.c @@ -882,18 +882,11 @@ static int pci1710_auto_attach(struct comedi_device *dev, return 0; } -static void pci1710_detach(struct comedi_device *dev) -{ - if (dev->iobase) - pci1710_reset(dev); - comedi_pci_detach(dev); -} - static struct comedi_driver adv_pci1710_driver = { .driver_name = "adv_pci1710", .module = THIS_MODULE, .auto_attach = pci1710_auto_attach, - .detach = pci1710_detach, + .detach = comedi_pci_detach, }; static int adv_pci1710_pci_probe(struct pci_dev *dev,