[PATCH] staging: comedi: ni_labpc: use comedi_range_is_unipolar()

Ian Abbott abbotti at mev.co.uk
Thu Aug 29 14:23:04 UTC 2013


On 2013-08-28 23:01, H Hartley Sweeten wrote:
> Use the core provided helper function instead of duplicating it as
> a private function.
>
> Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
> Cc: Ian Abbott <abbotti at mev.co.uk>
> Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
> ---
>   drivers/staging/comedi/drivers/ni_labpc.c | 10 ++--------
>   1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/ni_labpc.c b/drivers/staging/comedi/drivers/ni_labpc.c
> index 1add114..27daccb 100644
> --- a/drivers/staging/comedi/drivers/ni_labpc.c
> +++ b/drivers/staging/comedi/drivers/ni_labpc.c
> @@ -201,12 +201,6 @@ static int labpc_counter_set_mode(struct comedi_device *dev,
>   		return i8254_set_mode(base_address, 0, counter_number, mode);
>   }
>
> -static bool labpc_range_is_unipolar(struct comedi_subdevice *s,
> -				    unsigned int range)
> -{
> -	return s->range_table->range[range].min >= 0;
> -}
> -
>   static int labpc_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
>   {
>   	struct labpc_private *devpriv = dev->private;
> @@ -272,7 +266,7 @@ static void labpc_setup_cmd6_reg(struct comedi_device *dev,
>   		devpriv->cmd6 &= ~CMD6_NRSE;
>
>   	/* bipolar or unipolar range? */
> -	if (labpc_range_is_unipolar(s, range))
> +	if (comedi_range_is_unipolar(s, range))
>   		devpriv->cmd6 |= CMD6_ADCUNI;
>   	else
>   		devpriv->cmd6 &= ~CMD6_ADCUNI;
> @@ -1046,7 +1040,7 @@ static int labpc_ao_insn_write(struct comedi_device *dev,
>   	/* set range */
>   	if (board->is_labpc1200) {
>   		range = CR_RANGE(insn->chanspec);
> -		if (labpc_range_is_unipolar(s, range))
> +		if (comedi_range_is_unipolar(s, range))
>   			devpriv->cmd6 |= CMD6_DACUNI(channel);
>   		else
>   			devpriv->cmd6 &= ~CMD6_DACUNI(channel);
>

Reviewed-by: Ian Abbott <abbotti at mev.co.uk>

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti at mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-


More information about the devel mailing list