mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 11:33:28 +02:00
staging: comedi: pcmad: use comedi_range_is_bipolar()
Use the core provided helper function instead of duplicating it as a private function. 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>
This commit is contained in:
parent
b59f105c7e
commit
43db70a507
|
|
@ -75,12 +75,6 @@ static int pcmad_ai_wait_for_eoc(struct comedi_device *dev,
|
||||||
return -ETIME;
|
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,
|
static int pcmad_ai_insn_read(struct comedi_device *dev,
|
||||||
struct comedi_subdevice *s,
|
struct comedi_subdevice *s,
|
||||||
struct comedi_insn *insn,
|
struct comedi_insn *insn,
|
||||||
|
|
@ -106,7 +100,7 @@ static int pcmad_ai_insn_read(struct comedi_device *dev,
|
||||||
if (s->maxdata == 0x0fff)
|
if (s->maxdata == 0x0fff)
|
||||||
val >>= 4;
|
val >>= 4;
|
||||||
|
|
||||||
if (pcmad_range_is_bipolar(s, range)) {
|
if (comedi_range_is_bipolar(s, range)) {
|
||||||
/* munge the two's complement value */
|
/* munge the two's complement value */
|
||||||
val ^= ((s->maxdata + 1) >> 1);
|
val ^= ((s->maxdata + 1) >> 1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user