From: H Hartley Sweeten Date: Tue, 4 Nov 2014 17:54:35 +0000 (-0700) Subject: staging: comedi: addi_apci_3120: remove private data 'ui_AiNbrofChannels' X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2e8fcfdd057db84979d9c11cad94bb7e3a5d6af7;p=linux-beck.git staging: comedi: addi_apci_3120: remove private data 'ui_AiNbrofChannels' This member of the private data is always the cmd->chanlist_len. Use that instead and remove the member. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c index 1913fd2f29dd..004142efd2e6 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c @@ -361,7 +361,7 @@ static int apci3120_cyclic_ai(int mode, devpriv->ui_DmaActualBuffer = 0; /* Initializes the sequence array */ - if (!apci3120_setup_chan_list(dev, s, devpriv->ui_AiNbrofChannels, + if (!apci3120_setup_chan_list(dev, s, cmd->chanlist_len, cmd->chanlist)) return -EINVAL; @@ -605,9 +605,6 @@ static int apci3120_ai_cmd(struct comedi_device *dev, struct apci3120_private *devpriv = dev->private; struct comedi_cmd *cmd = &s->async->cmd; - /* loading private structure with cmd structure inputs */ - devpriv->ui_AiNbrofChannels = cmd->chanlist_len; - if (cmd->start_src == TRIG_EXT) devpriv->b_ExttrigEnable = APCI3120_ENABLE; else @@ -752,6 +749,7 @@ static irqreturn_t apci3120_interrupt(int irq, void *d) struct comedi_device *dev = d; struct apci3120_private *devpriv = dev->private; struct comedi_subdevice *s = dev->read_subdev; + struct comedi_cmd *cmd = &s->async->cmd; unsigned short int_daq; unsigned int int_amcc; @@ -791,7 +789,7 @@ static irqreturn_t apci3120_interrupt(int irq, void *d) unsigned short val; int i; - for (i = 0; i < devpriv->ui_AiNbrofChannels; i++) { + for (i = 0; i < cmd->chanlist_len; i++) { val = inw(dev->iobase + 0); comedi_buf_write_samples(s, &val, 1); } diff --git a/drivers/staging/comedi/drivers/addi_apci_3120.c b/drivers/staging/comedi/drivers/addi_apci_3120.c index dc05b2f616ca..2eb7ab5da7d7 100644 --- a/drivers/staging/comedi/drivers/addi_apci_3120.c +++ b/drivers/staging/comedi/drivers/addi_apci_3120.c @@ -113,7 +113,6 @@ struct apci3120_private { unsigned long amcc; unsigned long addon; unsigned int osc_base; - unsigned int ui_AiNbrofChannels; unsigned int ui_AiChannelList[32]; unsigned short us_UseDma; unsigned char b_DmaDoubleBuffer;