Commit d5a074b8a885c57211da746943eed0acd206dd99

Con Kolivas 2014-01-05T20:14:03

Use the usb read limit function for mcp2210 reads.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/mcp2210.c b/mcp2210.c
index 4ba35b3..b942d37 100644
--- a/mcp2210.c
+++ b/mcp2210.c
@@ -34,7 +34,7 @@ static bool mcp2210_recv(struct cgpu_info *cgpu, char *buf, enum usb_cmds cmd)
 	if (unlikely(cgpu->usbinfo.nodev))
 		return false;
 
-	err = usb_read_once_timeout(cgpu, buf, MCP2210_BUFFER_LENGTH, &amount, 1, cmd);
+	err = usb_read_limit(cgpu, buf, MCP2210_BUFFER_LENGTH, &amount, cmd);
 	if (err || amount != MCP2210_BUFFER_LENGTH) {
 		applog(LOG_WARNING, "%s %d: Error %d receiving %s received %d of %d",
 		       cgpu->drv->name, cgpu->device_id, err, usb_cmdname(cmd),