return ret;
}
-static int usbdux_pwm_pattern(struct comedi_device *dev,
- struct comedi_subdevice *s,
- unsigned int chan,
- unsigned int value,
- unsigned int sign)
+static void usbdux_pwm_pattern(struct comedi_device *dev,
+ struct comedi_subdevice *s,
+ unsigned int chan,
+ unsigned int value,
+ unsigned int sign)
{
struct usbdux_private *devpriv = dev->private;
char pwm_mask = (1 << chan); /* DIO bit for the PWM data */
c |= sgn_mask;
*buf++ = c;
}
- return 1;
}
static int usbdux_pwm_write(struct comedi_device *dev,
* The sign is set via a special INSN only, this gives us 8 bits
* for normal operation, sign is 0 by default.
*/
- return usbdux_pwm_pattern(dev, s, chan, data[0], 0);
+ usbdux_pwm_pattern(dev, s, chan, data[0], 0);
+
+ return insn->n;
}
static int usbdux_pwm_config(struct comedi_device *dev,
* data[1] = value
* data[2] = sign (for a relay)
*/
- return usbdux_pwm_pattern(dev, s, chan,
- data[1], (data[2] != 0));
+ usbdux_pwm_pattern(dev, s, chan, data[1], (data[2] != 0));
+ return 0;
case INSN_CONFIG_PWM_GET_H_BRIDGE:
/* values are not kept in this driver, nothing to return here */
return -EINVAL;