staging: comedi: usbdux: tidy up usbduxsub_pwm_irq()
Rename the local variables to the comedi "norm". Use dev->class_dev as the device for all dev_printk() messages. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e057288ffd
commit
c9f3363a30
1 changed files with 19 additions and 30 deletions
|
@ -1634,19 +1634,9 @@ static int usbdux_pwm_cancel(struct comedi_device *dev,
|
|||
|
||||
static void usbduxsub_pwm_irq(struct urb *urb)
|
||||
{
|
||||
struct comedi_device *dev = urb->context;
|
||||
struct usbdux_private *devpriv = dev->private;
|
||||
int ret;
|
||||
struct usbdux_private *this_usbduxsub;
|
||||
struct comedi_device *this_comedidev;
|
||||
struct comedi_subdevice *s;
|
||||
|
||||
/* printk(KERN_DEBUG "PWM: IRQ\n"); */
|
||||
|
||||
/* the context variable points to the subdevice */
|
||||
this_comedidev = urb->context;
|
||||
/* the private structure of the subdevice is struct usbdux_private */
|
||||
this_usbduxsub = this_comedidev->private;
|
||||
|
||||
s = &this_comedidev->subdevices[SUBDEV_DA];
|
||||
|
||||
switch (urb->status) {
|
||||
case 0:
|
||||
|
@ -1661,42 +1651,41 @@ static void usbduxsub_pwm_irq(struct urb *urb)
|
|||
* after an unlink command, unplug, ... etc
|
||||
* no unlink needed here. Already shutting down.
|
||||
*/
|
||||
if (this_usbduxsub->pwm_cmd_running)
|
||||
usbdux_pwm_stop(this_usbduxsub, 0);
|
||||
if (devpriv->pwm_cmd_running)
|
||||
usbdux_pwm_stop(devpriv, 0);
|
||||
|
||||
return;
|
||||
|
||||
default:
|
||||
/* a real error */
|
||||
if (this_usbduxsub->pwm_cmd_running) {
|
||||
dev_err(&this_usbduxsub->interface->dev,
|
||||
"comedi_: Non-zero urb status received in "
|
||||
"pwm intr context: %d\n", urb->status);
|
||||
usbdux_pwm_stop(this_usbduxsub, 0);
|
||||
if (devpriv->pwm_cmd_running) {
|
||||
dev_err(dev->class_dev,
|
||||
"Non-zero urb status received in pwm intr context: %d\n",
|
||||
urb->status);
|
||||
usbdux_pwm_stop(devpriv, 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* are we actually running? */
|
||||
if (!(this_usbduxsub->pwm_cmd_running))
|
||||
if (!devpriv->pwm_cmd_running)
|
||||
return;
|
||||
|
||||
urb->transfer_buffer_length = this_usbduxsub->size_pwm_buf;
|
||||
urb->dev = this_usbduxsub->usbdev;
|
||||
urb->transfer_buffer_length = devpriv->size_pwm_buf;
|
||||
urb->dev = devpriv->usbdev;
|
||||
urb->status = 0;
|
||||
if (this_usbduxsub->pwm_cmd_running) {
|
||||
if (devpriv->pwm_cmd_running) {
|
||||
ret = usb_submit_urb(urb, GFP_ATOMIC);
|
||||
if (ret < 0) {
|
||||
dev_err(&this_usbduxsub->interface->dev,
|
||||
"comedi_: pwm urb resubm failed in int-cont. "
|
||||
"ret=%d", ret);
|
||||
dev_err(dev->class_dev,
|
||||
"pwm urb resubm failed in int-cont. ret=%d",
|
||||
ret);
|
||||
if (ret == EL2NSYNC)
|
||||
dev_err(&this_usbduxsub->interface->dev,
|
||||
"buggy USB host controller or bug in "
|
||||
"IRQ handling!\n");
|
||||
dev_err(dev->class_dev,
|
||||
"buggy USB host controller or bug in IRQ handling!\n");
|
||||
|
||||
/* don't do an unlink here */
|
||||
usbdux_pwm_stop(this_usbduxsub, 0);
|
||||
usbdux_pwm_stop(devpriv, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue