[RFC PATCH 16/39] staging: comedi: usbduxfast: remove 'attached' from private data

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

 



The subdevice function pointers are only setup if the device is
attached. The 'attached' flag in the private data is unnecessary.
Remove it.

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, 9 deletions(-)

diff --git a/drivers/staging/comedi/drivers/usbduxfast.c b/drivers/staging/comedi/drivers/usbduxfast.c
index b9adf95..1486701 100644
--- a/drivers/staging/comedi/drivers/usbduxfast.c
+++ b/drivers/staging/comedi/drivers/usbduxfast.c
@@ -151,7 +151,6 @@ static const struct comedi_lrange range_usbduxfast_ai_range = {
  * one sub device just now: A/D
  */
 struct usbduxfast_private {
-	int attached;		/* is attached? */
 	struct usb_device *usb;	/* pointer to the usb-device */
 	struct urb *urbIn;	/* BULK-transfer handling: urb */
 	int8_t *transfer_buffer;
@@ -279,11 +278,6 @@ static void usbduxfast_ai_interrupt(struct urb *urb)
 		return;
 	}
 
-	if (unlikely(!devpriv->attached)) {
-		/* no comedi device there */
-		return;
-	}
-
 	/* first we test if something unusual has just happened */
 	switch (urb->status) {
 	case 0:
@@ -1249,8 +1243,6 @@ static int usbduxfast_attach_common(struct comedi_device *dev)
 	s->maxdata	= 0x1000;
 	s->range_table	= &range_usbduxfast_ai_range;
 
-	devpriv->attached = 1;
-
 	up(&devpriv->sem);
 
 	return 0;
@@ -1346,7 +1338,6 @@ static void usbduxfast_detach(struct comedi_device *dev)
 
 	down(&devpriv->sem);
 
-	devpriv->attached = 0;
 	devpriv->comedidev = NULL;
 
 	if (devpriv->intf)
-- 
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