Commit 8eea6dbd authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: usbduxsigma: tidy up usbdux_ai_inttrig()

Rename the function so it has namespace associated with the driver.
Rename the local variable used for the private data pointer.

Remove the dev_err() messages, they are just added noise.
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 2d4462d2
...@@ -754,36 +754,29 @@ static int receive_dux_commands(struct comedi_device *dev, int command) ...@@ -754,36 +754,29 @@ static int receive_dux_commands(struct comedi_device *dev, int command)
return -EFAULT; return -EFAULT;
} }
static int usbdux_ai_inttrig(struct comedi_device *dev, static int usbduxsigma_ai_inttrig(struct comedi_device *dev,
struct comedi_subdevice *s, unsigned int trignum) struct comedi_subdevice *s,
unsigned int trignum)
{ {
struct usbduxsigma_private *this_usbduxsub = dev->private; struct usbduxsigma_private *devpriv= dev->private;
int ret; int ret;
down(&this_usbduxsub->sem); if (trignum != 0)
if (trignum != 0) {
dev_err(&this_usbduxsub->interface->dev,
"comedi%d: usbdux_ai_inttrig: invalid trignum\n",
dev->minor);
up(&this_usbduxsub->sem);
return -EINVAL; return -EINVAL;
}
if (!this_usbduxsub->ai_cmd_running) { down(&devpriv->sem);
ret = usbduxsigma_submit_urbs(dev, this_usbduxsub->urbIn, if (!devpriv->ai_cmd_running) {
this_usbduxsub->numOfInBuffers, ret = usbduxsigma_submit_urbs(dev, devpriv->urbIn,
1); devpriv->numOfInBuffers, 1);
if (ret < 0) { if (ret < 0) {
up(&this_usbduxsub->sem); up(&devpriv->sem);
return ret; return ret;
} }
this_usbduxsub->ai_cmd_running = 1; devpriv->ai_cmd_running = 1;
s->async->inttrig = NULL; s->async->inttrig = NULL;
} else {
dev_err(&this_usbduxsub->interface->dev,
"comedi%d: ai_inttrig but acqu is already running\n",
dev->minor);
} }
up(&this_usbduxsub->sem); up(&devpriv->sem);
return 1; return 1;
} }
...@@ -893,7 +886,7 @@ static int usbdux_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -893,7 +886,7 @@ static int usbdux_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
/* TRIG_INT */ /* TRIG_INT */
/* don't enable the acquision operation */ /* don't enable the acquision operation */
/* wait for an internal signal */ /* wait for an internal signal */
s->async->inttrig = usbdux_ai_inttrig; s->async->inttrig = usbduxsigma_ai_inttrig;
} }
up(&this_usbduxsub->sem); up(&this_usbduxsub->sem);
return 0; return 0;
......
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