summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2013-07-30 00:45:47 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-01 00:44:56 (GMT)
commit89878614e24329209bf0d4efbb09fb5e431e7eb0 (patch)
treeff5651a171d0b5d2823e5e51cff809aedb49e0d2 /drivers/staging/comedi
parent893a27785c93ac76514cceb812eb41d059cd8f55 (diff)
downloadlinux-fsl-qoriq-89878614e24329209bf0d4efbb09fb5e431e7eb0.tar.xz
staging: comedi: usbdux: return void from usbdux_pwm_pattern()
This function never fails and currently returns '1' so that the usbdux_pwm_write() function returns to proper value (insn->n). It's also called by usbdux_pwm_config() which also returns the '1' value. The proper return code for this function should be '0' to indicate success. Change the return type of the function to void and just have the callers return the proper values. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r--drivers/staging/comedi/drivers/usbdux.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/staging/comedi/drivers/usbdux.c b/drivers/staging/comedi/drivers/usbdux.c
index b1fe329..9dcb297 100644
--- a/drivers/staging/comedi/drivers/usbdux.c
+++ b/drivers/staging/comedi/drivers/usbdux.c
@@ -1396,11 +1396,11 @@ pwm_start_exit:
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 */
@@ -1421,7 +1421,6 @@ static int usbdux_pwm_pattern(struct comedi_device *dev,
c |= sgn_mask;
*buf++ = c;
}
- return 1;
}
static int usbdux_pwm_write(struct comedi_device *dev,
@@ -1442,7 +1441,9 @@ 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,
@@ -1477,8 +1478,8 @@ 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;