diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-02-05 19:28:27 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-02-05 21:07:12 -0500 |
commit | 03754bdbb10a8045b2c18cfec8f2272d7df004c6 (patch) | |
tree | 2ada3c0d70fc51f8f9fa4ebdf76dc5d77b3e3c3d | |
parent | 9a23a7481ea860096acbc032dcb1159b8864fbf5 (diff) |
staging: comedi: vmk80xx: remove digital output (*insn_read)
The comedi core can use the (*insn_bits) function to emulate the
(*insn_read) function.
The digital output (*insn_bits) function properly handles the
VMK8061_MODEL to read the digital output states before returning.
Remove the unnecessary (*insn_read) function. It's also not
necessary to set the SDF_READABLE flag so remove the entire
conditional in the attach.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/comedi/drivers/vmk80xx.c | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/drivers/staging/comedi/drivers/vmk80xx.c b/drivers/staging/comedi/drivers/vmk80xx.c index 00f5784f0b59..4f32bad0136f 100644 --- a/drivers/staging/comedi/drivers/vmk80xx.c +++ b/drivers/staging/comedi/drivers/vmk80xx.c | |||
@@ -799,39 +799,6 @@ static int vmk80xx_do_insn_write(struct comedi_device *dev, | |||
799 | return n; | 799 | return n; |
800 | } | 800 | } |
801 | 801 | ||
802 | static int vmk80xx_do_insn_read(struct comedi_device *dev, | ||
803 | struct comedi_subdevice *s, | ||
804 | struct comedi_insn *insn, | ||
805 | unsigned int *data) | ||
806 | { | ||
807 | struct vmk80xx_private *devpriv = dev->private; | ||
808 | int chan; | ||
809 | int reg; | ||
810 | int n; | ||
811 | |||
812 | n = rudimentary_check(devpriv, DIR_IN); | ||
813 | if (n) | ||
814 | return n; | ||
815 | |||
816 | down(&devpriv->limit_sem); | ||
817 | chan = CR_CHAN(insn->chanspec); | ||
818 | |||
819 | reg = VMK8061_DO_REG; | ||
820 | |||
821 | devpriv->usb_tx_buf[0] = VMK8061_CMD_RD_DO; | ||
822 | |||
823 | for (n = 0; n < insn->n; n++) { | ||
824 | if (vmk80xx_read_packet(devpriv)) | ||
825 | break; | ||
826 | |||
827 | data[n] = (devpriv->usb_rx_buf[reg] >> chan) & 1; | ||
828 | } | ||
829 | |||
830 | up(&devpriv->limit_sem); | ||
831 | |||
832 | return n; | ||
833 | } | ||
834 | |||
835 | static int vmk80xx_do_insn_bits(struct comedi_device *dev, | 802 | static int vmk80xx_do_insn_bits(struct comedi_device *dev, |
836 | struct comedi_subdevice *s, | 803 | struct comedi_subdevice *s, |
837 | struct comedi_insn *insn, | 804 | struct comedi_insn *insn, |
@@ -1244,10 +1211,6 @@ static int vmk80xx_attach_common(struct comedi_device *dev) | |||
1244 | s->range_table = &range_digital; | 1211 | s->range_table = &range_digital; |
1245 | s->insn_write = vmk80xx_do_insn_write; | 1212 | s->insn_write = vmk80xx_do_insn_write; |
1246 | s->insn_bits = vmk80xx_do_insn_bits; | 1213 | s->insn_bits = vmk80xx_do_insn_bits; |
1247 | if (devpriv->model == VMK8061_MODEL) { | ||
1248 | s->subdev_flags |= SDF_READABLE; | ||
1249 | s->insn_read = vmk80xx_do_insn_read; | ||
1250 | } | ||
1251 | 1214 | ||
1252 | /* Counter subdevice */ | 1215 | /* Counter subdevice */ |
1253 | s = &dev->subdevices[4]; | 1216 | s = &dev->subdevices[4]; |