[PATCH 25/32] staging: comedi: vmk80xx: remove digital output (*insn_read)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/vmk80xx.c | 37 --------------------------------
 1 file changed, 37 deletions(-)

diff --git a/drivers/staging/comedi/drivers/vmk80xx.c b/drivers/staging/comedi/drivers/vmk80xx.c
index 00f5784..4f32bad 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,
 	return n;
 }
 
-static int vmk80xx_do_insn_read(struct comedi_device *dev,
-				struct comedi_subdevice *s,
-				struct comedi_insn *insn,
-				unsigned int *data)
-{
-	struct vmk80xx_private *devpriv = dev->private;
-	int chan;
-	int reg;
-	int n;
-
-	n = rudimentary_check(devpriv, DIR_IN);
-	if (n)
-		return n;
-
-	down(&devpriv->limit_sem);
-	chan = CR_CHAN(insn->chanspec);
-
-	reg = VMK8061_DO_REG;
-
-	devpriv->usb_tx_buf[0] = VMK8061_CMD_RD_DO;
-
-	for (n = 0; n < insn->n; n++) {
-		if (vmk80xx_read_packet(devpriv))
-			break;
-
-		data[n] = (devpriv->usb_rx_buf[reg] >> chan) & 1;
-	}
-
-	up(&devpriv->limit_sem);
-
-	return n;
-}
-
 static int vmk80xx_do_insn_bits(struct comedi_device *dev,
 				struct comedi_subdevice *s,
 				struct comedi_insn *insn,
@@ -1244,10 +1211,6 @@ static int vmk80xx_attach_common(struct comedi_device *dev)
 	s->range_table	= &range_digital;
 	s->insn_write	= vmk80xx_do_insn_write;
 	s->insn_bits	= vmk80xx_do_insn_bits;
-	if (devpriv->model == VMK8061_MODEL) {
-		s->subdev_flags	|= SDF_READABLE;
-		s->insn_read	= vmk80xx_do_insn_read;
-	}
 
 	/* Counter subdevice */
 	s = &dev->subdevices[4];
-- 
1.8.1.1.293.gfe73786

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux