Commit 3b081a43 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: usbduxsigma: rename usbdux_{ai,ao}_stop() functions

Rename the functions so they have namespace associated with the driver.

For aesthetic reasons, pass the comedi_device pointer instead of the
private data pointer as the first parameter.
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 cca5bf10
...@@ -213,8 +213,10 @@ struct usbduxsigma_private { ...@@ -213,8 +213,10 @@ struct usbduxsigma_private {
struct semaphore sem; struct semaphore sem;
}; };
static void usbdux_ai_stop(struct usbduxsigma_private *devpriv, int do_unlink) static void usbduxsigma_ai_stop(struct comedi_device *dev, int do_unlink)
{ {
struct usbduxsigma_private *devpriv = dev->private;
if (do_unlink) { if (do_unlink) {
int i; int i;
...@@ -234,7 +236,7 @@ static int usbduxsigma_ai_cancel(struct comedi_device *dev, ...@@ -234,7 +236,7 @@ static int usbduxsigma_ai_cancel(struct comedi_device *dev,
down(&devpriv->sem); down(&devpriv->sem);
/* unlink only if it is really running */ /* unlink only if it is really running */
usbdux_ai_stop(devpriv, devpriv->ai_cmd_running); usbduxsigma_ai_stop(dev, devpriv->ai_cmd_running);
up(&devpriv->sem); up(&devpriv->sem);
return 0; return 0;
...@@ -272,7 +274,7 @@ static void usbduxsigma_ai_urb_complete(struct urb *urb) ...@@ -272,7 +274,7 @@ static void usbduxsigma_ai_urb_complete(struct urb *urb)
case -ECONNABORTED: case -ECONNABORTED:
/* happens after an unlink command */ /* happens after an unlink command */
if (devpriv->ai_cmd_running) { if (devpriv->ai_cmd_running) {
usbdux_ai_stop(devpriv, 0); /* w/o unlink */ usbduxsigma_ai_stop(dev, 0); /* w/o unlink */
/* we are still running a command, tell comedi */ /* we are still running a command, tell comedi */
s->async->events |= (COMEDI_CB_EOA | COMEDI_CB_ERROR); s->async->events |= (COMEDI_CB_EOA | COMEDI_CB_ERROR);
comedi_event(dev, s); comedi_event(dev, s);
...@@ -288,7 +290,7 @@ static void usbduxsigma_ai_urb_complete(struct urb *urb) ...@@ -288,7 +290,7 @@ static void usbduxsigma_ai_urb_complete(struct urb *urb)
dev_err(dev->class_dev, dev_err(dev->class_dev,
"%s: non-zero urb status (%d)\n", "%s: non-zero urb status (%d)\n",
__func__, urb->status); __func__, urb->status);
usbdux_ai_stop(devpriv, 0); /* w/o unlink */ usbduxsigma_ai_stop(dev, 0); /* w/o unlink */
s->async->events |= (COMEDI_CB_EOA | COMEDI_CB_ERROR); s->async->events |= (COMEDI_CB_EOA | COMEDI_CB_ERROR);
comedi_event(dev, s); comedi_event(dev, s);
} }
...@@ -307,7 +309,7 @@ static void usbduxsigma_ai_urb_complete(struct urb *urb) ...@@ -307,7 +309,7 @@ static void usbduxsigma_ai_urb_complete(struct urb *urb)
if (ret == -EL2NSYNC) if (ret == -EL2NSYNC)
dev_err(dev->class_dev, dev_err(dev->class_dev,
"buggy USB host controller or bug in IRQ handler\n"); "buggy USB host controller or bug in IRQ handler\n");
usbdux_ai_stop(devpriv, 0); /* w/o unlink */ usbduxsigma_ai_stop(dev, 0); /* w/o unlink */
s->async->events |= (COMEDI_CB_EOA | COMEDI_CB_ERROR); s->async->events |= (COMEDI_CB_EOA | COMEDI_CB_ERROR);
comedi_event(dev, s); comedi_event(dev, s);
return; return;
...@@ -327,7 +329,7 @@ static void usbduxsigma_ai_urb_complete(struct urb *urb) ...@@ -327,7 +329,7 @@ static void usbduxsigma_ai_urb_complete(struct urb *urb)
/* not continuous, fixed number of samples */ /* not continuous, fixed number of samples */
devpriv->ai_sample_count--; devpriv->ai_sample_count--;
if (devpriv->ai_sample_count < 0) { if (devpriv->ai_sample_count < 0) {
usbdux_ai_stop(devpriv, 0); /* w/o unlink */ usbduxsigma_ai_stop(dev, 0); /* w/o unlink */
/* acquistion is over, tell comedi */ /* acquistion is over, tell comedi */
s->async->events |= COMEDI_CB_EOA; s->async->events |= COMEDI_CB_EOA;
comedi_event(dev, s); comedi_event(dev, s);
...@@ -345,7 +347,7 @@ static void usbduxsigma_ai_urb_complete(struct urb *urb) ...@@ -345,7 +347,7 @@ static void usbduxsigma_ai_urb_complete(struct urb *urb)
ret = cfc_write_array_to_buffer(s, &val, sizeof(uint32_t)); ret = cfc_write_array_to_buffer(s, &val, sizeof(uint32_t));
if (unlikely(ret == 0)) { if (unlikely(ret == 0)) {
/* buffer overflow */ /* buffer overflow */
usbdux_ai_stop(devpriv, 0); /* w/o unlink */ usbduxsigma_ai_stop(dev, 0); /* w/o unlink */
return; return;
} }
} }
...@@ -354,8 +356,10 @@ static void usbduxsigma_ai_urb_complete(struct urb *urb) ...@@ -354,8 +356,10 @@ static void usbduxsigma_ai_urb_complete(struct urb *urb)
comedi_event(dev, s); comedi_event(dev, s);
} }
static void usbdux_ao_stop(struct usbduxsigma_private *devpriv, int do_unlink) static void usbduxsigma_ao_stop(struct comedi_device *dev, int do_unlink)
{ {
struct usbduxsigma_private *devpriv = dev->private;
if (do_unlink) { if (do_unlink) {
int i; int i;
...@@ -375,7 +379,7 @@ static int usbduxsigma_ao_cancel(struct comedi_device *dev, ...@@ -375,7 +379,7 @@ static int usbduxsigma_ao_cancel(struct comedi_device *dev,
down(&devpriv->sem); down(&devpriv->sem);
/* unlink only if it is really running */ /* unlink only if it is really running */
usbdux_ao_stop(devpriv, devpriv->ao_cmd_running); usbduxsigma_ao_stop(dev, devpriv->ao_cmd_running);
up(&devpriv->sem); up(&devpriv->sem);
return 0; return 0;
...@@ -402,7 +406,7 @@ static void usbduxsigma_ao_urb_complete(struct urb *urb) ...@@ -402,7 +406,7 @@ static void usbduxsigma_ao_urb_complete(struct urb *urb)
case -ECONNABORTED: case -ECONNABORTED:
/* happens after an unlink command */ /* happens after an unlink command */
if (devpriv->ao_cmd_running) { if (devpriv->ao_cmd_running) {
usbdux_ao_stop(devpriv, 0); /* w/o unlink */ usbduxsigma_ao_stop(dev, 0); /* w/o unlink */
s->async->events |= COMEDI_CB_EOA; s->async->events |= COMEDI_CB_EOA;
comedi_event(dev, s); comedi_event(dev, s);
} }
...@@ -414,7 +418,7 @@ static void usbduxsigma_ao_urb_complete(struct urb *urb) ...@@ -414,7 +418,7 @@ static void usbduxsigma_ao_urb_complete(struct urb *urb)
dev_err(dev->class_dev, dev_err(dev->class_dev,
"%s: non-zero urb status (%d)\n", "%s: non-zero urb status (%d)\n",
__func__, urb->status); __func__, urb->status);
usbdux_ao_stop(devpriv, 0); /* w/o unlink */ usbduxsigma_ao_stop(dev, 0); /* w/o unlink */
s->async->events |= (COMEDI_CB_ERROR | COMEDI_CB_EOA); s->async->events |= (COMEDI_CB_ERROR | COMEDI_CB_EOA);
comedi_event(dev, s); comedi_event(dev, s);
} }
...@@ -433,7 +437,7 @@ static void usbduxsigma_ao_urb_complete(struct urb *urb) ...@@ -433,7 +437,7 @@ static void usbduxsigma_ao_urb_complete(struct urb *urb)
/* not continuous, fixed number of samples */ /* not continuous, fixed number of samples */
devpriv->ao_sample_count--; devpriv->ao_sample_count--;
if (devpriv->ao_sample_count < 0) { if (devpriv->ao_sample_count < 0) {
usbdux_ao_stop(devpriv, 0); /* w/o unlink */ usbduxsigma_ao_stop(dev, 0); /* w/o unlink */
/* acquistion is over, tell comedi */ /* acquistion is over, tell comedi */
s->async->events |= COMEDI_CB_EOA; s->async->events |= COMEDI_CB_EOA;
comedi_event(dev, s); comedi_event(dev, s);
...@@ -483,7 +487,7 @@ static void usbduxsigma_ao_urb_complete(struct urb *urb) ...@@ -483,7 +487,7 @@ static void usbduxsigma_ao_urb_complete(struct urb *urb)
if (ret == EL2NSYNC) if (ret == EL2NSYNC)
dev_err(dev->class_dev, dev_err(dev->class_dev,
"buggy USB host controller or bug in IRQ handler\n"); "buggy USB host controller or bug in IRQ handler\n");
usbdux_ao_stop(devpriv, 0); /* w/o unlink */ usbduxsigma_ao_stop(dev, 0); /* w/o unlink */
s->async->events |= (COMEDI_CB_EOA | COMEDI_CB_ERROR); s->async->events |= (COMEDI_CB_EOA | COMEDI_CB_ERROR);
comedi_event(dev, s); comedi_event(dev, s);
} }
...@@ -1649,8 +1653,8 @@ static void usbduxsigma_free_usb_buffers(struct comedi_device *dev) ...@@ -1649,8 +1653,8 @@ static void usbduxsigma_free_usb_buffers(struct comedi_device *dev)
int i; int i;
/* force unlink all urbs */ /* force unlink all urbs */
usbdux_ai_stop(devpriv, 1); usbduxsigma_ai_stop(dev, 1);
usbdux_ao_stop(devpriv, 1); usbduxsigma_ao_stop(dev, 1);
usbduxsigma_pwm_stop(dev, 1); usbduxsigma_pwm_stop(dev, 1);
urb = devpriv->urbPwm; urb = devpriv->urbPwm;
......
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