Commit 7c346c2c authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: usbduxfast: remove 'attached' from private data

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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 50a4cf9b
...@@ -148,7 +148,6 @@ static const struct comedi_lrange range_usbduxfast_ai_range = { ...@@ -148,7 +148,6 @@ static const struct comedi_lrange range_usbduxfast_ai_range = {
* one sub device just now: A/D * one sub device just now: A/D
*/ */
struct usbduxfast_private { struct usbduxfast_private {
int attached; /* is attached? */
struct usb_device *usb; /* pointer to the usb-device */ struct usb_device *usb; /* pointer to the usb-device */
struct urb *urbIn; /* BULK-transfer handling: urb */ struct urb *urbIn; /* BULK-transfer handling: urb */
int8_t *transfer_buffer; int8_t *transfer_buffer;
...@@ -276,11 +275,6 @@ static void usbduxfast_ai_interrupt(struct urb *urb) ...@@ -276,11 +275,6 @@ static void usbduxfast_ai_interrupt(struct urb *urb)
return; return;
} }
if (unlikely(!devpriv->attached)) {
/* no comedi device there */
return;
}
/* first we test if something unusual has just happened */ /* first we test if something unusual has just happened */
switch (urb->status) { switch (urb->status) {
case 0: case 0:
...@@ -1246,8 +1240,6 @@ static int usbduxfast_attach_common(struct comedi_device *dev) ...@@ -1246,8 +1240,6 @@ static int usbduxfast_attach_common(struct comedi_device *dev)
s->maxdata = 0x1000; s->maxdata = 0x1000;
s->range_table = &range_usbduxfast_ai_range; s->range_table = &range_usbduxfast_ai_range;
devpriv->attached = 1;
up(&devpriv->sem); up(&devpriv->sem);
return 0; return 0;
...@@ -1343,7 +1335,6 @@ static void usbduxfast_detach(struct comedi_device *dev) ...@@ -1343,7 +1335,6 @@ static void usbduxfast_detach(struct comedi_device *dev)
down(&devpriv->sem); down(&devpriv->sem);
devpriv->attached = 0;
devpriv->comedidev = NULL; devpriv->comedidev = NULL;
if (devpriv->intf) if (devpriv->intf)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment