aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2013-06-18 16:22:25 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-24 18:51:01 -0400
commitdbe9c7929c6c0021414d61f85fe4e2f20f069e1c (patch)
treedf40105fde5aba0898de2defc52b45aa38e78320
parentd9990ceacc39b4320661adf7778538858a5c4bad (diff)
staging: comedi: pcmuio: remove 'num_asic_chans'
This member of the subdevice private data is always initialize to s->n_chan if the subdevice supports interrupts and is only used in functions that can be called by the interrupt subdevice. Simplyfy the driver a bit by removing it and just using s->n_chan. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/comedi/drivers/pcmuio.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/staging/comedi/drivers/pcmuio.c b/drivers/staging/comedi/drivers/pcmuio.c
index 8771e4b5d4cb..e5758814e161 100644
--- a/drivers/staging/comedi/drivers/pcmuio.c
+++ b/drivers/staging/comedi/drivers/pcmuio.c
@@ -153,11 +153,6 @@ struct pcmuio_subdev_private {
153 /* if non-negative, this subdev has an interrupt asic */ 153 /* if non-negative, this subdev has an interrupt asic */
154 int asic; 154 int asic;
155 /* 155 /*
156 * the number of asic channels in this
157 * subdev that have interrutps
158 */
159 int num_asic_chans;
160 /*
161 * if nonnegative, the first channel id with 156 * if nonnegative, the first channel id with
162 * respect to the asic that has interrupts 157 * respect to the asic that has interrupts
163 */ 158 */
@@ -374,7 +369,7 @@ static void pcmuio_handle_intr_subdev(struct comedi_device *dev,
374 goto done; 369 goto done;
375 370
376 mytrig = triggered >> subpriv->intr.asic_chan; 371 mytrig = triggered >> subpriv->intr.asic_chan;
377 mytrig &= ((0x1 << subpriv->intr.num_asic_chans) - 1); 372 mytrig &= ((0x1 << s->n_chan) - 1);
378 373
379 if (!(mytrig & subpriv->intr.enabled_mask)) 374 if (!(mytrig & subpriv->intr.enabled_mask))
380 goto done; 375 goto done;
@@ -517,7 +512,7 @@ static int pcmuio_start_intr(struct comedi_device *dev,
517 << CR_CHAN(cmd->chanlist[n]); 512 << CR_CHAN(cmd->chanlist[n]);
518 } 513 }
519 } 514 }
520 bits &= ((0x1 << subpriv->intr.num_asic_chans) - 1); 515 bits &= ((0x1 << s->n_chan) - 1);
521 subpriv->intr.enabled_mask = bits; 516 subpriv->intr.enabled_mask = bits;
522 517
523 /* set pol and enab intrs for this subdev.. */ 518 /* set pol and enab intrs for this subdev.. */
@@ -724,7 +719,6 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
724 s->n_chan = min(chans_left, MAX_CHANS_PER_SUBDEV); 719 s->n_chan = min(chans_left, MAX_CHANS_PER_SUBDEV);
725 subpriv->intr.asic = -1; 720 subpriv->intr.asic = -1;
726 subpriv->intr.asic_chan = -1; 721 subpriv->intr.asic_chan = -1;
727 subpriv->intr.num_asic_chans = -1;
728 subpriv->intr.active = 0; 722 subpriv->intr.active = 0;
729 s->len_chanlist = 1; 723 s->len_chanlist = 1;
730 724
@@ -748,13 +742,12 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
748 subpriv->intr.active = 0; 742 subpriv->intr.active = 0;
749 subpriv->intr.stop_count = 0; 743 subpriv->intr.stop_count = 0;
750 subpriv->intr.asic_chan = thisasic_chanct; 744 subpriv->intr.asic_chan = thisasic_chanct;
751 subpriv->intr.num_asic_chans = s->n_chan;
752 dev->read_subdev = s; 745 dev->read_subdev = s;
753 s->subdev_flags |= SDF_CMD_READ; 746 s->subdev_flags |= SDF_CMD_READ;
754 s->cancel = pcmuio_cancel; 747 s->cancel = pcmuio_cancel;
755 s->do_cmd = pcmuio_cmd; 748 s->do_cmd = pcmuio_cmd;
756 s->do_cmdtest = pcmuio_cmdtest; 749 s->do_cmdtest = pcmuio_cmdtest;
757 s->len_chanlist = subpriv->intr.num_asic_chans; 750 s->len_chanlist = s->n_chan;
758 } 751 }
759 thisasic_chanct += CHANS_PER_PORT; 752 thisasic_chanct += CHANS_PER_PORT;
760 } 753 }