[PATCH 06/77] staging: comedi: usbduxsigma: remove check of 'probed' in (*cancel) functions

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

 



The comedi_device private data variable 'probed' is set after the usb_driver
has completed its (*probe) before calling comedi_usb_auto_config(). That
function calls the comedi_driver (*auto_attach) which will set the
comedi_device 'private' variable and initialize the subdevices.

The subdevice (*cancel) functions can only be called after the (*auto_attach)
has completed successfully so the sanity checks of 'probed' are unnecessary.
Remove them.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/usbduxsigma.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/staging/comedi/drivers/usbduxsigma.c b/drivers/staging/comedi/drivers/usbduxsigma.c
index 68b2d04..c0e2f9e 100644
--- a/drivers/staging/comedi/drivers/usbduxsigma.c
+++ b/drivers/staging/comedi/drivers/usbduxsigma.c
@@ -286,10 +286,6 @@ static int usbdux_ai_cancel(struct comedi_device *dev,
 
 	/* prevent other CPUs from submitting new commands just now */
 	down(&this_usbduxsub->sem);
-	if (!(this_usbduxsub->probed)) {
-		up(&this_usbduxsub->sem);
-		return -ENODEV;
-	}
 	/* unlink only if the urb really has been submitted */
 	usbdux_ai_stop(this_usbduxsub, this_usbduxsub->ai_cmd_running);
 	up(&this_usbduxsub->sem);
@@ -471,10 +467,6 @@ static int usbdux_ao_cancel(struct comedi_device *dev,
 
 	/* prevent other CPUs from submitting a command just now */
 	down(&this_usbduxsub->sem);
-	if (!(this_usbduxsub->probed)) {
-		up(&this_usbduxsub->sem);
-		return -ENODEV;
-	}
 	/* unlink only if it is really running */
 	usbdux_ao_stop(this_usbduxsub, this_usbduxsub->ao_cmd_running);
 	up(&this_usbduxsub->sem);
-- 
1.8.1.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/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