Commit 6028f4c0 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: usbduxsigma: tidy up usbduxsub_submit_PwmURBs()

Rename the CamelCase function.

Pass the comedi_device pointer instead of the private data pointer
to the function.

Use a couple local variables to tidy up the function.

Remove the dev_err() message when usb_submit_urb() fails, its 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 125a77fc
...@@ -1481,29 +1481,18 @@ static void usbduxsub_pwm_irq(struct urb *urb) ...@@ -1481,29 +1481,18 @@ static void usbduxsub_pwm_irq(struct urb *urb)
} }
} }
static int usbduxsub_submit_PwmURBs(struct usbduxsigma_private *usbduxsub) static int usbduxsigma_submit_pwm_urb(struct comedi_device *dev)
{ {
int errFlag; struct usb_device *usb = comedi_to_usb_dev(dev);
struct usbduxsigma_private *devpriv = dev->private;
if (!usbduxsub) struct urb *urb = devpriv->urbPwm;
return -EFAULT;
/* in case of a resubmission after an unlink... */ /* in case of a resubmission after an unlink... */
usb_fill_bulk_urb(usbduxsub->urbPwm, usb_fill_bulk_urb(urb, usb, usb_sndbulkpipe(usb, PWM_EP),
usbduxsub->usbdev, urb->transfer_buffer, devpriv->sizePwmBuf,
usb_sndbulkpipe(usbduxsub->usbdev, PWM_EP), usbduxsub_pwm_irq, dev);
usbduxsub->urbPwm->transfer_buffer,
usbduxsub->sizePwmBuf, usbduxsub_pwm_irq, return usb_submit_urb(urb, GFP_ATOMIC);
usbduxsub->comedidev);
errFlag = usb_submit_urb(usbduxsub->urbPwm, GFP_ATOMIC);
if (errFlag) {
dev_err(&usbduxsub->interface->dev,
"comedi_: usbduxsigma: pwm: usb_submit_urb error %d\n",
errFlag);
return errFlag;
}
return 0;
} }
static int usbdux_pwm_period(struct comedi_device *dev, static int usbdux_pwm_period(struct comedi_device *dev,
...@@ -1552,12 +1541,11 @@ static int usbdux_pwm_start(struct comedi_device *dev, ...@@ -1552,12 +1541,11 @@ static int usbdux_pwm_start(struct comedi_device *dev,
for (i = 0; i < this_usbduxsub->sizePwmBuf; i++) for (i = 0; i < this_usbduxsub->sizePwmBuf; i++)
((char *)(this_usbduxsub->urbPwm->transfer_buffer))[i] = 0; ((char *)(this_usbduxsub->urbPwm->transfer_buffer))[i] = 0;
this_usbduxsub->pwm_cmd_running = 1; ret = usbduxsigma_submit_pwm_urb(dev);
ret = usbduxsub_submit_PwmURBs(this_usbduxsub); if (ret < 0)
if (ret < 0) {
this_usbduxsub->pwm_cmd_running = 0;
return ret; return ret;
} this_usbduxsub->pwm_cmd_running = 1;
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