From aa25b91304bbca0c79c6b1d736236cd2f817ca03 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Mon, 29 Jul 2013 17:46:07 -0700 Subject: [PATCH] staging: comedi: usbduxsigma: return void from usbduxsigma_pwm_pattern() This function never fails and currently returns '1' so that the usbduxsigma_pwm_write() function returns to proper value (insn->n). It's also called by usbduxsigma_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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/usbduxsigma.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/staging/comedi/drivers/usbduxsigma.c b/drivers/staging/comedi/drivers/usbduxsigma.c index ca6d9528f8cb..660eec28540f 100644 --- a/drivers/staging/comedi/drivers/usbduxsigma.c +++ b/drivers/staging/comedi/drivers/usbduxsigma.c @@ -1238,11 +1238,11 @@ static int usbduxsigma_pwm_start(struct comedi_device *dev, return 0; } -static int usbduxsigma_pwm_pattern(struct comedi_device *dev, - struct comedi_subdevice *s, - unsigned int chan, - unsigned int value, - unsigned int sign) +static void usbduxsigma_pwm_pattern(struct comedi_device *dev, + struct comedi_subdevice *s, + unsigned int chan, + unsigned int value, + unsigned int sign) { struct usbduxsigma_private *devpriv = dev->private; char pwm_mask = (1 << chan); /* DIO bit for the PWM data */ @@ -1263,7 +1263,6 @@ static int usbduxsigma_pwm_pattern(struct comedi_device *dev, c |= sgn_mask; *buf++ = c; } - return 1; } static int usbduxsigma_pwm_write(struct comedi_device *dev, @@ -1284,7 +1283,9 @@ static int usbduxsigma_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 usbduxsigma_pwm_pattern(dev, s, chan, data[0], 0); + usbduxsigma_pwm_pattern(dev, s, chan, data[0], 0); + + return insn->n; } static int usbduxsigma_pwm_config(struct comedi_device *dev, @@ -1319,8 +1320,8 @@ static int usbduxsigma_pwm_config(struct comedi_device *dev, * data[1] = value * data[2] = sign (for a relay) */ - return usbduxsigma_pwm_pattern(dev, s, chan, - data[1], (data[2] != 0)); + usbduxsigma_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 */ return -EINVAL; -- 2.39.5