提交 e3693fd3 编写于 作者: H H Hartley Sweeten 提交者: Greg Kroah-Hartman

staging: comedi: introduce comedi_range_is_{bi,uni}polar()

Introduce some helper functions to check if a given 'range' index
to a comedi_subdevice 'range_table' is a bipolar or unipolar range.
Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 9a8e7f63
......@@ -307,6 +307,18 @@ struct comedi_lrange {
struct comedi_krange range[GCC_ZERO_LENGTH_ARRAY];
};
static inline bool comedi_range_is_bipolar(struct comedi_subdevice *s,
unsigned int range)
{
return s->range_table->range[range].min < 0;
}
static inline bool comedi_range_is_unipolar(struct comedi_subdevice *s,
unsigned int range)
{
return s->range_table->range[range].min >= 0;
}
/* some silly little inline functions */
static inline unsigned int bytes_per_sample(const struct comedi_subdevice *subd)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册