Staging: comedi: Remove comedi_krange typedef
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
d0a353f637
commit
1f6325d629
@ -310,7 +310,6 @@ enum comedi_support_level {
|
|||||||
|
|
||||||
/* structures */
|
/* structures */
|
||||||
|
|
||||||
typedef struct comedi_krange_struct comedi_krange;
|
|
||||||
typedef struct comedi_bufconfig_struct comedi_bufconfig;
|
typedef struct comedi_bufconfig_struct comedi_bufconfig;
|
||||||
typedef struct comedi_bufinfo_struct comedi_bufinfo;
|
typedef struct comedi_bufinfo_struct comedi_bufinfo;
|
||||||
|
|
||||||
@ -382,7 +381,7 @@ struct comedi_rangeinfo {
|
|||||||
void *range_ptr;
|
void *range_ptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct comedi_krange_struct {
|
struct comedi_krange {
|
||||||
int min; /* fixed point, multiply by 1e-6 */
|
int min; /* fixed point, multiply by 1e-6 */
|
||||||
int max; /* fixed point, multiply by 1e-6 */
|
int max; /* fixed point, multiply by 1e-6 */
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
|
@ -409,7 +409,7 @@ extern const struct comedi_lrange range_unknown;
|
|||||||
|
|
||||||
struct comedi_lrange {
|
struct comedi_lrange {
|
||||||
int length;
|
int length;
|
||||||
comedi_krange range[GCC_ZERO_LENGTH_ARRAY];
|
struct comedi_krange range[GCC_ZERO_LENGTH_ARRAY];
|
||||||
};
|
};
|
||||||
|
|
||||||
/* some silly little inline functions */
|
/* some silly little inline functions */
|
||||||
|
@ -103,7 +103,7 @@ int comedi_get_rangetype(void *dev, unsigned int subdevice,
|
|||||||
unsigned int comedi_get_subdevice_flags(void *dev, unsigned int subdevice);
|
unsigned int comedi_get_subdevice_flags(void *dev, unsigned int subdevice);
|
||||||
int comedi_get_len_chanlist(void *dev, unsigned int subdevice);
|
int comedi_get_len_chanlist(void *dev, unsigned int subdevice);
|
||||||
int comedi_get_krange(void *dev, unsigned int subdevice, unsigned int
|
int comedi_get_krange(void *dev, unsigned int subdevice, unsigned int
|
||||||
chan, unsigned int range, comedi_krange *krange);
|
chan, unsigned int range, struct comedi_krange *krange);
|
||||||
unsigned int comedi_get_buf_head_pos(void *dev, unsigned int subdevice);
|
unsigned int comedi_get_buf_head_pos(void *dev, unsigned int subdevice);
|
||||||
int comedi_set_user_int_count(void *dev, unsigned int subdevice,
|
int comedi_set_user_int_count(void *dev, unsigned int subdevice,
|
||||||
unsigned int buf_user_count);
|
unsigned int buf_user_count);
|
||||||
@ -177,7 +177,7 @@ unsigned int comedi_get_subdevice_flags(unsigned int minor, unsigned int
|
|||||||
subdevice);
|
subdevice);
|
||||||
int comedi_get_len_chanlist(unsigned int minor, unsigned int subdevice);
|
int comedi_get_len_chanlist(unsigned int minor, unsigned int subdevice);
|
||||||
int comedi_get_krange(unsigned int minor, unsigned int subdevice, unsigned int
|
int comedi_get_krange(unsigned int minor, unsigned int subdevice, unsigned int
|
||||||
chan, unsigned int range, comedi_krange *krange);
|
chan, unsigned int range, struct comedi_krange *krange);
|
||||||
unsigned int comedi_get_buf_head_pos(unsigned int minor, unsigned int
|
unsigned int comedi_get_buf_head_pos(unsigned int minor, unsigned int
|
||||||
subdevice);
|
subdevice);
|
||||||
int comedi_set_user_int_count(unsigned int minor, unsigned int subdevice,
|
int comedi_set_user_int_count(unsigned int minor, unsigned int subdevice,
|
||||||
|
@ -1203,7 +1203,7 @@ COMEDI_PCI_INITCLEANUP(driver_cb_pcidas, pcidas64_pci_table);
|
|||||||
static unsigned int ai_range_bits_6xxx(const struct comedi_device * dev,
|
static unsigned int ai_range_bits_6xxx(const struct comedi_device * dev,
|
||||||
unsigned int range_index)
|
unsigned int range_index)
|
||||||
{
|
{
|
||||||
const comedi_krange *range =
|
const struct comedi_krange *range =
|
||||||
&board(dev)->ai_range_table->range[range_index];
|
&board(dev)->ai_range_table->range[range_index];
|
||||||
unsigned int bits = 0;
|
unsigned int bits = 0;
|
||||||
|
|
||||||
|
@ -442,7 +442,7 @@ static short fake_sawtooth(struct comedi_device *dev, unsigned int range_index,
|
|||||||
struct comedi_subdevice *s = dev->read_subdev;
|
struct comedi_subdevice *s = dev->read_subdev;
|
||||||
unsigned int offset = s->maxdata / 2;
|
unsigned int offset = s->maxdata / 2;
|
||||||
u64 value;
|
u64 value;
|
||||||
const comedi_krange *krange = &s->range_table->range[range_index];
|
const struct comedi_krange *krange = &s->range_table->range[range_index];
|
||||||
u64 binary_amplitude;
|
u64 binary_amplitude;
|
||||||
|
|
||||||
binary_amplitude = s->maxdata;
|
binary_amplitude = s->maxdata;
|
||||||
@ -463,7 +463,7 @@ static short fake_squarewave(struct comedi_device *dev, unsigned int range_index
|
|||||||
struct comedi_subdevice *s = dev->read_subdev;
|
struct comedi_subdevice *s = dev->read_subdev;
|
||||||
unsigned int offset = s->maxdata / 2;
|
unsigned int offset = s->maxdata / 2;
|
||||||
u64 value;
|
u64 value;
|
||||||
const comedi_krange *krange = &s->range_table->range[range_index];
|
const struct comedi_krange *krange = &s->range_table->range[range_index];
|
||||||
current_time %= devpriv->usec_period;
|
current_time %= devpriv->usec_period;
|
||||||
|
|
||||||
value = s->maxdata;
|
value = s->maxdata;
|
||||||
|
@ -1375,7 +1375,7 @@ static int das16_attach(struct comedi_device * dev, struct comedi_devconfig * it
|
|||||||
unsigned int dma_chan;
|
unsigned int dma_chan;
|
||||||
int timer_mode;
|
int timer_mode;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
comedi_krange *user_ai_range, *user_ao_range;
|
struct comedi_krange *user_ai_range, *user_ao_range;
|
||||||
|
|
||||||
iobase = it->options[0];
|
iobase = it->options[0];
|
||||||
#if 0
|
#if 0
|
||||||
@ -1496,7 +1496,7 @@ static int das16_attach(struct comedi_device * dev, struct comedi_devconfig * it
|
|||||||
(it->options[4] || it->options[5])) {
|
(it->options[4] || it->options[5])) {
|
||||||
// allocate single-range range table
|
// allocate single-range range table
|
||||||
devpriv->user_ai_range_table =
|
devpriv->user_ai_range_table =
|
||||||
kmalloc(sizeof(struct comedi_lrange) + sizeof(comedi_krange),
|
kmalloc(sizeof(struct comedi_lrange) + sizeof(struct comedi_krange),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
// initialize ai range
|
// initialize ai range
|
||||||
devpriv->user_ai_range_table->length = 1;
|
devpriv->user_ai_range_table->length = 1;
|
||||||
@ -1509,7 +1509,7 @@ static int das16_attach(struct comedi_device * dev, struct comedi_devconfig * it
|
|||||||
if (it->options[6] || it->options[7]) {
|
if (it->options[6] || it->options[7]) {
|
||||||
// allocate single-range range table
|
// allocate single-range range table
|
||||||
devpriv->user_ao_range_table =
|
devpriv->user_ao_range_table =
|
||||||
kmalloc(sizeof(struct comedi_lrange) + sizeof(comedi_krange),
|
kmalloc(sizeof(struct comedi_lrange) + sizeof(struct comedi_krange),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
// initialize ao range
|
// initialize ao range
|
||||||
devpriv->user_ao_range_table->length = 1;
|
devpriv->user_ao_range_table->length = 1;
|
||||||
|
@ -156,7 +156,7 @@ typedef struct {
|
|||||||
int model_no;
|
int model_no;
|
||||||
struct {
|
struct {
|
||||||
int length;
|
int length;
|
||||||
comedi_krange range;
|
struct comedi_krange range;
|
||||||
} range[9];
|
} range[9];
|
||||||
const struct comedi_lrange *range_table_list[8 * 7 + 2];
|
const struct comedi_lrange *range_table_list[8 * 7 + 2];
|
||||||
unsigned int maxdata_list[8 * 7 + 2];
|
unsigned int maxdata_list[8 * 7 + 2];
|
||||||
|
@ -2818,7 +2818,7 @@ static int ni_m_series_ao_config_chanlist(struct comedi_device * dev,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (i = 0; i < n_chans; i++) {
|
for (i = 0; i < n_chans; i++) {
|
||||||
const comedi_krange *krange;
|
const struct comedi_krange *krange;
|
||||||
chan = CR_CHAN(chanspec[i]);
|
chan = CR_CHAN(chanspec[i]);
|
||||||
range = CR_RANGE(chanspec[i]);
|
range = CR_RANGE(chanspec[i]);
|
||||||
krange = s->range_table->range + range;
|
krange = s->range_table->range + range;
|
||||||
|
@ -63,7 +63,7 @@ static const serial2002_board serial2002_boards[] = {
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
// HACK...
|
// HACK...
|
||||||
int length;
|
int length;
|
||||||
comedi_krange range;
|
struct comedi_krange range;
|
||||||
} serial2002_range_table_t;
|
} serial2002_range_table_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -149,7 +149,7 @@ int comedi_get_n_ranges(void *d, unsigned int subdevice, unsigned int chan)
|
|||||||
* ALPHA (non-portable)
|
* ALPHA (non-portable)
|
||||||
*/
|
*/
|
||||||
int comedi_get_krange(void *d, unsigned int subdevice, unsigned int chan,
|
int comedi_get_krange(void *d, unsigned int subdevice, unsigned int chan,
|
||||||
unsigned int range, comedi_krange *krange)
|
unsigned int range, struct comedi_krange *krange)
|
||||||
{
|
{
|
||||||
struct comedi_device *dev = (struct comedi_device *) d;
|
struct comedi_device *dev = (struct comedi_device *) d;
|
||||||
struct comedi_subdevice *s = dev->subdevices + subdevice;
|
struct comedi_subdevice *s = dev->subdevices + subdevice;
|
||||||
@ -163,7 +163,7 @@ int comedi_get_krange(void *d, unsigned int subdevice, unsigned int chan,
|
|||||||
if (range >= lr->length)
|
if (range >= lr->length)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
memcpy(krange, lr->range + range, sizeof(comedi_krange));
|
memcpy(krange, lr->range + range, sizeof(struct comedi_krange));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ const struct comedi_lrange range_unknown = { 1, {{0, 1000000, UNIT_none}} };
|
|||||||
range info structure
|
range info structure
|
||||||
|
|
||||||
writes:
|
writes:
|
||||||
n comedi_krange structures to rangeinfo->range_ptr
|
n struct comedi_krange structures to rangeinfo->range_ptr
|
||||||
*/
|
*/
|
||||||
int do_rangeinfo_ioctl(struct comedi_device *dev, struct comedi_rangeinfo *arg)
|
int do_rangeinfo_ioctl(struct comedi_device *dev, struct comedi_rangeinfo *arg)
|
||||||
{
|
{
|
||||||
@ -78,7 +78,7 @@ int do_rangeinfo_ioctl(struct comedi_device *dev, struct comedi_rangeinfo *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (copy_to_user(it.range_ptr, lr->range,
|
if (copy_to_user(it.range_ptr, lr->range,
|
||||||
sizeof(comedi_krange) * lr->length))
|
sizeof(struct comedi_krange) * lr->length))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user