From: H Hartley Sweeten Date: Mon, 17 Feb 2014 21:27:25 +0000 (-0700) Subject: staging: comedi: pcl818: remove 'ai_n_chan' from private data X-Git-Tag: firefly_0821_release~176^2~4193^2~957 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=41bbe835f1cd48a14af2cd3a3a9b41e1528f07dc;p=firefly-linux-kernel-4.4.55.git staging: comedi: pcl818: remove 'ai_n_chan' from private data This member of the private data is just a copy of the cmd->chanlist_len. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/pcl818.c b/drivers/staging/comedi/drivers/pcl818.c index eea48ded0413..f73fc791a13c 100644 --- a/drivers/staging/comedi/drivers/pcl818.c +++ b/drivers/staging/comedi/drivers/pcl818.c @@ -341,7 +341,6 @@ struct pcl818_private { unsigned int act_chanlist[16]; /* MUX setting for actual AI operations */ unsigned int act_chanlist_len; /* how long is actual MUX list */ unsigned int act_chanlist_pos; /* actual position in MUX list */ - unsigned int ai_n_chan; /* how many channels is measured */ unsigned int *ai_chanlist; /* actaul chanlist */ unsigned int ai_flags; /* flaglist */ unsigned int ai_data_len; /* len of data buffer */ @@ -515,6 +514,7 @@ static irqreturn_t interrupt_pcl818_ai_mode13_int(int irq, void *d) struct comedi_device *dev = d; struct pcl818_private *devpriv = dev->private; struct comedi_subdevice *s = dev->read_subdev; + struct comedi_cmd *cmd = &s->async->cmd; unsigned int chan; int timeout = 50; /* wait max 50us */ @@ -549,7 +549,7 @@ conv_finish: devpriv->act_chanlist_pos = 0; s->async->cur_chan++; - if (s->async->cur_chan >= devpriv->ai_n_chan) { + if (s->async->cur_chan >= cmd->chanlist_len) { s->async->cur_chan = 0; devpriv->ai_act_scan--; } @@ -573,6 +573,7 @@ static irqreturn_t interrupt_pcl818_ai_mode13_dma(int irq, void *d) struct comedi_device *dev = d; struct pcl818_private *devpriv = dev->private; struct comedi_subdevice *s = dev->read_subdev; + struct comedi_cmd *cmd = &s->async->cmd; int i, len, bufptr; unsigned long flags; unsigned short *ptr; @@ -622,7 +623,7 @@ static irqreturn_t interrupt_pcl818_ai_mode13_dma(int irq, void *d) devpriv->act_chanlist_pos = 0; s->async->cur_chan++; - if (s->async->cur_chan >= devpriv->ai_n_chan) { + if (s->async->cur_chan >= cmd->chanlist_len) { s->async->cur_chan = 0; devpriv->ai_act_scan--; } @@ -650,6 +651,7 @@ static irqreturn_t interrupt_pcl818_ai_mode13_fifo(int irq, void *d) struct comedi_device *dev = d; struct pcl818_private *devpriv = dev->private; struct comedi_subdevice *s = dev->read_subdev; + struct comedi_cmd *cmd = &s->async->cmd; int i, len; unsigned char lo; @@ -698,7 +700,7 @@ static irqreturn_t interrupt_pcl818_ai_mode13_fifo(int irq, void *d) devpriv->act_chanlist_pos = 0; s->async->cur_chan++; - if (s->async->cur_chan >= devpriv->ai_n_chan) { + if (s->async->cur_chan >= cmd->chanlist_len) { s->async->cur_chan = 0; devpriv->ai_act_scan--; } @@ -796,7 +798,7 @@ static void pcl818_ai_mode13dma_int(int mode, struct comedi_device *dev, disable_dma(devpriv->dma); /* disable dma */ bytes = devpriv->hwdmasize[0]; if (!devpriv->neverending_ai) { - bytes = devpriv->ai_n_chan * cmd->stop_arg * sizeof(short); /* how many */ + bytes = cmd->chanlist_len * cmd->stop_arg * sizeof(short); /* how many */ devpriv->dma_runs_to_end = bytes / devpriv->hwdmasize[0]; /* how many DMA pages we must fiil */ devpriv->last_dma_run = bytes % devpriv->hwdmasize[0]; /* on last dma transfer must be moved */ devpriv->dma_runs_to_end--; @@ -840,11 +842,11 @@ static int pcl818_ai_cmd_mode(int mode, struct comedi_device *dev, start_pacer(dev, -1, 0, 0); /* stop pacer */ seglen = check_channel_list(dev, s, devpriv->ai_chanlist, - devpriv->ai_n_chan); + cmd->chanlist_len); if (seglen < 1) return -EINVAL; setup_channel_list(dev, s, devpriv->ai_chanlist, - devpriv->ai_n_chan, seglen); + cmd->chanlist_len, seglen); udelay(1); @@ -1115,7 +1117,6 @@ static int ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) struct comedi_cmd *cmd = &s->async->cmd; int retval; - devpriv->ai_n_chan = cmd->chanlist_len; devpriv->ai_chanlist = cmd->chanlist; devpriv->ai_flags = cmd->flags; devpriv->ai_data_len = s->async->prealloc_bufsz;