[PATCH v3 11/13] staging: comedi: usbduxfast: remove unnecessary semaphore down/up

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

 



The semaphore down/up in usbduxfast_attach_common() is not necessary.
This function is only called as part of the (*auto_attach) and does
not talk to the USB device.

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

diff --git a/drivers/staging/comedi/drivers/usbduxfast.c b/drivers/staging/comedi/drivers/usbduxfast.c
index 9e846b4..149b558 100644
--- a/drivers/staging/comedi/drivers/usbduxfast.c
+++ b/drivers/staging/comedi/drivers/usbduxfast.c
@@ -842,17 +842,12 @@ static int usbduxfast_ai_insn_read(struct comedi_device *dev,
 
 static int usbduxfast_attach_common(struct comedi_device *dev)
 {
-	struct usbduxfast_private *devpriv = dev->private;
 	struct comedi_subdevice *s;
 	int ret;
 
-	down(&devpriv->sem);
-
 	ret = comedi_alloc_subdevices(dev, 1);
-	if (ret) {
-		up(&devpriv->sem);
+	if (ret)
 		return ret;
-	}
 
 	/* Analog Input subdevice */
 	s = &dev->subdevices[0];
@@ -868,8 +863,6 @@ static int usbduxfast_attach_common(struct comedi_device *dev)
 	s->maxdata	= 0x1000;	/* 12-bit + 1 overflow bit */
 	s->range_table	= &range_usbduxfast_ai_range;
 
-	up(&devpriv->sem);
-
 	return 0;
 }
 
-- 
2.4.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