Commit 4b1fea00 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: adv_pci1710: remove 'ai_data_len' from private data

This member of the private data is just a copy of the s->async->prealloc_bufsz.
Use that instead.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 07d93d1a
...@@ -314,7 +314,6 @@ struct pci1710_private { ...@@ -314,7 +314,6 @@ struct pci1710_private {
unsigned char act_chanlist_len; /* len of scanlist */ unsigned char act_chanlist_len; /* len of scanlist */
unsigned char act_chanlist_pos; /* actual position in MUX list */ unsigned char act_chanlist_pos; /* actual position in MUX list */
unsigned char da_ranges; /* copy of D/A outpit range register */ unsigned char da_ranges; /* copy of D/A outpit range register */
unsigned int ai_data_len; /* len of data buffer */
unsigned short ao_data[4]; /* data output buffer */ unsigned short ao_data[4]; /* data output buffer */
unsigned int cnt0_write_wait; /* after a write, wait for update of the unsigned int cnt0_write_wait; /* after a write, wait for update of the
* internal state */ * internal state */
...@@ -888,8 +887,8 @@ static void interrupt_pci1710_half_fifo(void *d) ...@@ -888,8 +887,8 @@ static void interrupt_pci1710_half_fifo(void *d)
} }
samplesinbuf = this_board->fifo_half_size; samplesinbuf = this_board->fifo_half_size;
if (samplesinbuf * sizeof(short) >= devpriv->ai_data_len) { if (samplesinbuf * sizeof(short) >= s->async->prealloc_bufsz) {
m = devpriv->ai_data_len / sizeof(short); m = s->async->prealloc_bufsz / sizeof(short);
if (move_block_from_fifo(dev, s, m, 0)) if (move_block_from_fifo(dev, s, m, 0))
return; return;
samplesinbuf -= m; samplesinbuf -= m;
...@@ -1114,11 +1113,8 @@ static int pci171x_ai_cmdtest(struct comedi_device *dev, ...@@ -1114,11 +1113,8 @@ static int pci171x_ai_cmdtest(struct comedi_device *dev,
*/ */
static int pci171x_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) static int pci171x_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
{ {
struct pci1710_private *devpriv = dev->private;
struct comedi_cmd *cmd = &s->async->cmd; struct comedi_cmd *cmd = &s->async->cmd;
devpriv->ai_data_len = s->async->prealloc_bufsz;
if (cmd->scan_begin_src == TRIG_FOLLOW) { /* mode 1, 2, 3 */ if (cmd->scan_begin_src == TRIG_FOLLOW) { /* mode 1, 2, 3 */
if (cmd->convert_src == TRIG_TIMER) { /* mode 1 and 2 */ if (cmd->convert_src == TRIG_TIMER) { /* mode 1 and 2 */
return pci171x_ai_docmd_and_mode(cmd->start_src == return pci171x_ai_docmd_and_mode(cmd->start_src ==
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment