Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325471
b: refs/heads/master
c: 4e5ba2f
h: refs/heads/master
i:
  325469: 2c28789
  325467: b27aa64
  325463: fe55ea8
  325455: 067161e
  325439: 60d2a53
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 21, 2012
1 parent 6fdce80 commit ae67860
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 52 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 453443f32fd8d5fb3da702aa02901297dd4ad51f
refs/heads/master: 4e5ba2f6bd1c480ce6b362a17a6a3456a2354cf0
54 changes: 3 additions & 51 deletions trunk/drivers/staging/comedi/drivers/usbduxfast.c
Original file line number Diff line number Diff line change
Expand Up @@ -1430,20 +1430,15 @@ static void tidy_up(struct usbduxfastsub_s *udfs)
udfs->ai_cmd_running = 0;
}

/* common part of attach and attach_usb */
static int usbduxfast_attach_common(struct comedi_device *dev,
struct usbduxfastsub_s *udfs,
void *aux_data, int aux_len)
struct usbduxfastsub_s *udfs)
{
int ret;
struct comedi_subdevice *s;

down(&udfs->sem);
/* pointer back to the corresponding comedi device */
udfs->comedidev = dev;
/* trying to upload the firmware into the chip */
if (aux_data)
firmwareUpload(udfs, aux_data, aux_len);
dev->board_name = "usbduxfast";
ret = comedi_alloc_subdevices(dev, 1);
if (ret) {
Expand Down Expand Up @@ -1485,48 +1480,6 @@ static int usbduxfast_attach_common(struct comedi_device *dev,
return 0;
}

/* is called for COMEDI_DEVCONFIG ioctl (when comedi_config is run) */
static int usbduxfast_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
int ret;
int index;
int i;
void *aux_data;
int aux_len;

dev->private = NULL;

aux_data = comedi_aux_data(it->options, 0);
aux_len = it->options[COMEDI_DEVCONF_AUX_DATA_LENGTH];
if (aux_data == NULL)
aux_len = 0;
else if (aux_len == 0)
aux_data = NULL;
down(&start_stop_sem);
/*
* find a valid device which has been detected by the
* probe function of the usb
*/
index = -1;
for (i = 0; i < NUMUSBDUXFAST; i++) {
if (usbduxfastsub[i].probed && !usbduxfastsub[i].attached) {
index = i;
break;
}
}
if (index < 0) {
dev_err(dev->class_dev,
"usbduxfast: error: attach failed, no usbduxfast devs connected to the usb bus.\n");
ret = -ENODEV;
} else
ret = usbduxfast_attach_common(dev, &usbduxfastsub[index],
aux_data, aux_len);
up(&start_stop_sem);
return ret;
}

/* is called from comedi_usb_auto_config() */
static int usbduxfast_attach_usb(struct comedi_device *dev,
struct usb_interface *uinterf)
{
Expand All @@ -1545,7 +1498,7 @@ static int usbduxfast_attach_usb(struct comedi_device *dev,
"usbduxfast: error: attach_usb failed, already attached\n");
ret = -ENODEV;
} else
ret = usbduxfast_attach_common(dev, udfs, NULL, 0);
ret = usbduxfast_attach_common(dev, udfs);
up(&start_stop_sem);
return ret;
}
Expand All @@ -1568,9 +1521,8 @@ static void usbduxfast_detach(struct comedi_device *dev)
static struct comedi_driver usbduxfast_driver = {
.driver_name = "usbduxfast",
.module = THIS_MODULE,
.attach = usbduxfast_attach,
.detach = usbduxfast_detach,
.attach_usb = usbduxfast_attach_usb,
.detach = usbduxfast_detach,
};

static void usbduxfast_firmware_request_complete_handler(const struct firmware
Expand Down

0 comments on commit ae67860

Please sign in to comment.