[PATCH v2 31/33] staging: comedi: dt9812: usb_bulk_msg() timeout is in milliseconds

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

 



The timeout values passed to usb_bulk_msg() should be in milliseconds
not jiffies.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/dt9812.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt9812.c b/drivers/staging/comedi/drivers/dt9812.c
index 99f4872..9281d49 100644
--- a/drivers/staging/comedi/drivers/dt9812.c
+++ b/drivers/staging/comedi/drivers/dt9812.c
@@ -52,6 +52,9 @@ for my needs.
 #define DT9812_MAX_WRITE_CMD_PIPE_SIZE	32
 #define DT9812_MAX_READ_CMD_PIPE_SIZE	32
 
+/* usb_bulk_msg() timout in milliseconds */
+#define DT9812_USB_TIMEOUT		1000
+
 /*
  * See Silican Laboratories C8051F020/1/2/3 manual
  */
@@ -262,12 +265,12 @@ static int dt9812_read_info(struct comedi_device *dev,
 
 	/* DT9812 only responds to 32 byte writes!! */
 	ret = usb_bulk_msg(usb, usb_sndbulkpipe(usb, devpriv->cmd_wr.addr),
-			   &cmd, 32, &count, HZ * 1);
+			   &cmd, 32, &count, DT9812_USB_TIMEOUT);
 	if (ret)
 		return ret;
 
 	return usb_bulk_msg(usb, usb_rcvbulkpipe(usb, devpriv->cmd_rd.addr),
-			    buf, buf_size, &count, HZ * 1);
+			    buf, buf_size, &count, DT9812_USB_TIMEOUT);
 }
 
 static int dt9812_read_multiple_registers(struct comedi_device *dev,
@@ -287,12 +290,12 @@ static int dt9812_read_multiple_registers(struct comedi_device *dev,
 
 	/* DT9812 only responds to 32 byte writes!! */
 	ret = usb_bulk_msg(usb, usb_sndbulkpipe(usb, devpriv->cmd_wr.addr),
-			   &cmd, 32, &count, HZ * 1);
+			   &cmd, 32, &count, DT9812_USB_TIMEOUT);
 	if (ret)
 		return ret;
 
 	return usb_bulk_msg(usb, usb_rcvbulkpipe(usb, devpriv->cmd_rd.addr),
-			    value, reg_count, &count, HZ * 1);
+			    value, reg_count, &count, DT9812_USB_TIMEOUT);
 }
 
 static int dt9812_write_multiple_registers(struct comedi_device *dev,
@@ -314,7 +317,7 @@ static int dt9812_write_multiple_registers(struct comedi_device *dev,
 
 	/* DT9812 only responds to 32 byte writes!! */
 	return usb_bulk_msg(usb, usb_sndbulkpipe(usb, devpriv->cmd_wr.addr),
-			    &cmd, 32, &count, HZ * 1);
+			    &cmd, 32, &count, DT9812_USB_TIMEOUT);
 }
 
 static int dt9812_rmw_multiple_registers(struct comedi_device *dev,
@@ -334,7 +337,7 @@ static int dt9812_rmw_multiple_registers(struct comedi_device *dev,
 
 	/* DT9812 only responds to 32 byte writes!! */
 	return usb_bulk_msg(usb, usb_sndbulkpipe(usb, devpriv->cmd_wr.addr),
-			    &cmd, 32, &count, HZ * 1);
+			    &cmd, 32, &count, DT9812_USB_TIMEOUT);
 }
 
 static int dt9812_digital_in(struct comedi_device *dev, u8 *bits)
-- 
1.8.1.4

_______________________________________________
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