Commit 8ffffae6 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: das800: add a local var for the comedi_cmd pointer

For aesthetics, use a local variable to access the comedi_cmd as a
pointer in das800_ai_do_cmd() instead of getting to it from the
comedi_async pointer.
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 d54e5e6b
...@@ -404,9 +404,10 @@ static int das800_ai_do_cmd(struct comedi_device *dev, ...@@ -404,9 +404,10 @@ static int das800_ai_do_cmd(struct comedi_device *dev,
const struct das800_board *thisboard = comedi_board(dev); const struct das800_board *thisboard = comedi_board(dev);
struct das800_private *devpriv = dev->private; struct das800_private *devpriv = dev->private;
struct comedi_async *async = s->async; struct comedi_async *async = s->async;
unsigned int gain = CR_RANGE(async->cmd.chanlist[0]); struct comedi_cmd *cmd = &async->cmd;
unsigned int start_chan = CR_CHAN(async->cmd.chanlist[0]); unsigned int gain = CR_RANGE(cmd->chanlist[0]);
unsigned int end_chan = (start_chan + async->cmd.chanlist_len - 1) % 8; unsigned int start_chan = CR_CHAN(cmd->chanlist[0]);
unsigned int end_chan = (start_chan + cmd->chanlist_len - 1) % 8;
unsigned int scan_chans = (end_chan << 3) | start_chan; unsigned int scan_chans = (end_chan << 3) | start_chan;
int conv_bits; int conv_bits;
unsigned long irq_flags; unsigned long irq_flags;
...@@ -424,8 +425,8 @@ static int das800_ai_do_cmd(struct comedi_device *dev, ...@@ -424,8 +425,8 @@ static int das800_ai_do_cmd(struct comedi_device *dev,
gain &= 0xf; gain &= 0xf;
outb(gain, dev->iobase + DAS800_GAIN); outb(gain, dev->iobase + DAS800_GAIN);
if (async->cmd.stop_src == TRIG_COUNT) { if (cmd->stop_src == TRIG_COUNT) {
devpriv->count = async->cmd.stop_arg * async->cmd.chanlist_len; devpriv->count = cmd->stop_arg * cmd->chanlist_len;
devpriv->forever = false; devpriv->forever = false;
} else { /* TRIG_NONE */ } else { /* TRIG_NONE */
devpriv->forever = true; devpriv->forever = true;
...@@ -437,9 +438,9 @@ static int das800_ai_do_cmd(struct comedi_device *dev, ...@@ -437,9 +438,9 @@ static int das800_ai_do_cmd(struct comedi_device *dev,
*/ */
conv_bits = 0; conv_bits = 0;
conv_bits |= EACS | IEOC; conv_bits |= EACS | IEOC;
if (async->cmd.start_src == TRIG_EXT) if (cmd->start_src == TRIG_EXT)
conv_bits |= DTEN; conv_bits |= DTEN;
if (async->cmd.convert_src == TRIG_TIMER) { if (cmd->convert_src == TRIG_TIMER) {
conv_bits |= CASC | ITE; conv_bits |= CASC | ITE;
/* set conversion frequency */ /* set conversion frequency */
das800_set_frequency(dev); das800_set_frequency(dev);
......
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