提交 95760280 编写于 作者: H H Hartley Sweeten 提交者: Greg Kroah-Hartman

staging: comedi: usbduxfast: tidy up usbduxfast_attach_common()

Remove the unnecessary comments and tidy up the whitespace in
this function.

Also, remove the dev_info() at the end. It's just added noise.
Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 2e7a3099
...@@ -1376,11 +1376,11 @@ static void tidy_up(struct usbduxfast_private *devpriv) ...@@ -1376,11 +1376,11 @@ static void tidy_up(struct usbduxfast_private *devpriv)
static int usbduxfast_attach_common(struct comedi_device *dev, static int usbduxfast_attach_common(struct comedi_device *dev,
struct usbduxfast_private *devpriv) struct usbduxfast_private *devpriv)
{ {
int ret;
struct comedi_subdevice *s; struct comedi_subdevice *s;
int ret;
down(&devpriv->sem); down(&devpriv->sem);
/* pointer back to the corresponding comedi device */
devpriv->comedidev = dev; devpriv->comedidev = dev;
ret = comedi_alloc_subdevices(dev, 1); ret = comedi_alloc_subdevices(dev, 1);
...@@ -1388,38 +1388,27 @@ static int usbduxfast_attach_common(struct comedi_device *dev, ...@@ -1388,38 +1388,27 @@ static int usbduxfast_attach_common(struct comedi_device *dev,
up(&devpriv->sem); up(&devpriv->sem);
return ret; return ret;
} }
/* private structure is also simply the usb-structure */
dev->private = devpriv; dev->private = devpriv;
/* the first subdevice is the A/D converter */
/* Analog Input subdevice */
s = &dev->subdevices[SUBDEV_AD]; s = &dev->subdevices[SUBDEV_AD];
/*
* the URBs get the comedi subdevice which is responsible for reading
* this is the subdevice which reads data
*/
dev->read_subdev = s; dev->read_subdev = s;
/* the subdevice receives as private structure the usb-structure */ s->type = COMEDI_SUBD_AI;
s->private = NULL; s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_CMD_READ;
/* analog input */ s->n_chan = 16;
s->type = COMEDI_SUBD_AI; s->len_chanlist = 16;
/* readable and ref is to ground */ s->insn_read = usbduxfast_ai_insn_read;
s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_CMD_READ; s->do_cmdtest = usbduxfast_ai_cmdtest;
/* 16 channels */ s->do_cmd = usbduxfast_ai_cmd;
s->n_chan = 16; s->cancel = usbduxfast_ai_cancel;
/* length of the channellist */ s->maxdata = 0x1000;
s->len_chanlist = 16; s->range_table = &range_usbduxfast_ai_range;
/* callback functions */
s->insn_read = usbduxfast_ai_insn_read;
s->do_cmdtest = usbduxfast_ai_cmdtest;
s->do_cmd = usbduxfast_ai_cmd;
s->cancel = usbduxfast_ai_cancel;
/* max value from the A/D converter (12bit+1 bit for overflow) */
s->maxdata = 0x1000;
/* range table to convert to physical units */
s->range_table = &range_usbduxfast_ai_range;
/* finally decide that it's attached */
devpriv->attached = 1; devpriv->attached = 1;
up(&devpriv->sem); up(&devpriv->sem);
dev_info(dev->class_dev, "successfully attached to usbduxfast.\n");
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册