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

staging: comedi: pcmuio: remove 'first_chan'

This member of the subdevice private data is always initialize to
'0' due to the 'byte_no' always being zero when it is set during
the attach. Simplify the driver a bit by removing it.
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 3de38f25
...@@ -152,8 +152,6 @@ struct pcmuio_subdev_private { ...@@ -152,8 +152,6 @@ struct pcmuio_subdev_private {
struct { struct {
/* if non-negative, this subdev has an interrupt asic */ /* if non-negative, this subdev has an interrupt asic */
int asic; int asic;
/* if nonnegative, the first channel id for interrupts */
int first_chan;
/* /*
* the number of asic channels in this * the number of asic channels in this
* subdev that have interrutps * subdev that have interrutps
...@@ -377,7 +375,6 @@ static void pcmuio_handle_intr_subdev(struct comedi_device *dev, ...@@ -377,7 +375,6 @@ static void pcmuio_handle_intr_subdev(struct comedi_device *dev,
mytrig = triggered >> subpriv->intr.asic_chan; mytrig = triggered >> subpriv->intr.asic_chan;
mytrig &= ((0x1 << subpriv->intr.num_asic_chans) - 1); mytrig &= ((0x1 << subpriv->intr.num_asic_chans) - 1);
mytrig <<= subpriv->intr.first_chan;
if (!(mytrig & subpriv->intr.enabled_mask)) if (!(mytrig & subpriv->intr.enabled_mask))
goto done; goto done;
...@@ -520,8 +517,7 @@ static int pcmuio_start_intr(struct comedi_device *dev, ...@@ -520,8 +517,7 @@ static int pcmuio_start_intr(struct comedi_device *dev,
<< CR_CHAN(cmd->chanlist[n]); << CR_CHAN(cmd->chanlist[n]);
} }
} }
bits &= ((0x1 << subpriv->intr.num_asic_chans) - bits &= ((0x1 << subpriv->intr.num_asic_chans) - 1);
1) << subpriv->intr.first_chan;
subpriv->intr.enabled_mask = bits; subpriv->intr.enabled_mask = bits;
/* set pol and enab intrs for this subdev.. */ /* set pol and enab intrs for this subdev.. */
...@@ -727,7 +723,6 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -727,7 +723,6 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->insn_config = pcmuio_dio_insn_config; s->insn_config = pcmuio_dio_insn_config;
s->n_chan = min(chans_left, MAX_CHANS_PER_SUBDEV); s->n_chan = min(chans_left, MAX_CHANS_PER_SUBDEV);
subpriv->intr.asic = -1; subpriv->intr.asic = -1;
subpriv->intr.first_chan = -1;
subpriv->intr.asic_chan = -1; subpriv->intr.asic_chan = -1;
subpriv->intr.num_asic_chans = -1; subpriv->intr.num_asic_chans = -1;
subpriv->intr.active = 0; subpriv->intr.active = 0;
...@@ -752,10 +747,8 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -752,10 +747,8 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
subpriv->intr.asic = asic; subpriv->intr.asic = asic;
subpriv->intr.active = 0; subpriv->intr.active = 0;
subpriv->intr.stop_count = 0; subpriv->intr.stop_count = 0;
subpriv->intr.first_chan = byte_no * 8;
subpriv->intr.asic_chan = thisasic_chanct; subpriv->intr.asic_chan = thisasic_chanct;
subpriv->intr.num_asic_chans = subpriv->intr.num_asic_chans = s->n_chan;
s->n_chan - subpriv->intr.first_chan;
dev->read_subdev = s; dev->read_subdev = s;
s->subdev_flags |= SDF_CMD_READ; s->subdev_flags |= SDF_CMD_READ;
s->cancel = pcmuio_cancel; s->cancel = pcmuio_cancel;
......
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