[PATCH] staging: comedi: pcmad: use comedi_range_is_bipolar()

Ian Abbott abbotti at mev.co.uk
Thu Aug 29 14:22:39 UTC 2013


On 2013-08-28 22:59, 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/pcmad.c | 8 +-------
>   1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/pcmad.c b/drivers/staging/comedi/drivers/pcmad.c
> index 423f236..fe482fd 100644
> --- a/drivers/staging/comedi/drivers/pcmad.c
> +++ b/drivers/staging/comedi/drivers/pcmad.c
> @@ -75,12 +75,6 @@ static int pcmad_ai_wait_for_eoc(struct comedi_device *dev,
>   	return -ETIME;
>   }
>
> -static bool pcmad_range_is_bipolar(struct comedi_subdevice *s,
> -				   unsigned int range)
> -{
> -	return s->range_table->range[range].min < 0;
> -}
> -
>   static int pcmad_ai_insn_read(struct comedi_device *dev,
>   			      struct comedi_subdevice *s,
>   			      struct comedi_insn *insn,
> @@ -106,7 +100,7 @@ static int pcmad_ai_insn_read(struct comedi_device *dev,
>   		if (s->maxdata == 0x0fff)
>   			val >>= 4;
>
> -		if (pcmad_range_is_bipolar(s, range)) {
> +		if (comedi_range_is_bipolar(s, range)) {
>   			/* munge the two's complement value */
>   			val ^= ((s->maxdata + 1) >> 1);
>   		}
>

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