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

H Hartley Sweeten hsweeten at visionengravers.com
Tue May 14 20:32:32 UTC 2013


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 at visionengravers.com>
Cc: Ian Abbott <abbotti at mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh at linuxfonudation.org>
---
 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 3043024..59bbd4d 100644
--- a/drivers/staging/comedi/drivers/usbduxfast.c
+++ b/drivers/staging/comedi/drivers/usbduxfast.c
@@ -148,7 +148,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;
@@ -276,11 +275,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:
@@ -1246,8 +1240,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;
@@ -1343,7 +1335,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




More information about the devel mailing list