staging: comedi: s626: use a local var for the s->async in s626_irq_handler()
The comedi_async pointer is used a number of times in this function. For aesthetic reasons, use a local variable for the pointer. Also, since was already have a pointer to the "cmd" use that in the for loop instead of s->async->cmd (or even async->cmd). Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
abafc9e851
commit
3b00b8570a
@ -732,7 +732,8 @@ static irqreturn_t s626_irq_handler(int irq, void *d)
|
|||||||
struct comedi_device *dev = d;
|
struct comedi_device *dev = d;
|
||||||
struct s626_private *devpriv = dev->private;
|
struct s626_private *devpriv = dev->private;
|
||||||
struct comedi_subdevice *s = dev->read_subdev;
|
struct comedi_subdevice *s = dev->read_subdev;
|
||||||
struct comedi_cmd *cmd = &s->async->cmd;
|
struct comedi_async *async = s->async;
|
||||||
|
struct comedi_cmd *cmd = &async->cmd;
|
||||||
struct enc_private *k;
|
struct enc_private *k;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int32_t *readaddr;
|
int32_t *readaddr;
|
||||||
@ -767,21 +768,21 @@ static irqreturn_t s626_irq_handler(int irq, void *d)
|
|||||||
readaddr = (int32_t *) devpriv->ANABuf.LogicalBase + 1;
|
readaddr = (int32_t *) devpriv->ANABuf.LogicalBase + 1;
|
||||||
|
|
||||||
/* get the data and hand it over to comedi */
|
/* get the data and hand it over to comedi */
|
||||||
for (i = 0; i < (s->async->cmd.chanlist_len); i++) {
|
for (i = 0; i < cmd->chanlist_len; i++) {
|
||||||
/* Convert ADC data to 16-bit integer values and copy to application */
|
/* Convert ADC data to 16-bit integer values and copy to application */
|
||||||
/* buffer. */
|
/* buffer. */
|
||||||
tempdata = s626_ai_reg_to_uint((int)*readaddr);
|
tempdata = s626_ai_reg_to_uint((int)*readaddr);
|
||||||
readaddr++;
|
readaddr++;
|
||||||
|
|
||||||
/* put data into read buffer */
|
/* put data into read buffer */
|
||||||
/* comedi_buf_put(s->async, tempdata); */
|
/* comedi_buf_put(async, tempdata); */
|
||||||
if (cfc_write_to_buffer(s, tempdata) == 0)
|
if (cfc_write_to_buffer(s, tempdata) == 0)
|
||||||
printk
|
printk
|
||||||
("s626_irq_handler: cfc_write_to_buffer error!\n");
|
("s626_irq_handler: cfc_write_to_buffer error!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* end of scan occurs */
|
/* end of scan occurs */
|
||||||
s->async->events |= COMEDI_CB_EOS;
|
async->events |= COMEDI_CB_EOS;
|
||||||
|
|
||||||
if (!(devpriv->ai_continous))
|
if (!(devpriv->ai_continous))
|
||||||
devpriv->ai_sample_count--;
|
devpriv->ai_sample_count--;
|
||||||
@ -792,7 +793,7 @@ static irqreturn_t s626_irq_handler(int irq, void *d)
|
|||||||
MC_DISABLE(P_MC1, MC1_ERPS1);
|
MC_DISABLE(P_MC1, MC1_ERPS1);
|
||||||
|
|
||||||
/* send end of acquisition */
|
/* send end of acquisition */
|
||||||
s->async->events |= COMEDI_CB_EOA;
|
async->events |= COMEDI_CB_EOA;
|
||||||
|
|
||||||
/* disable master interrupt */
|
/* disable master interrupt */
|
||||||
irqstatus = 0;
|
irqstatus = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user