summaryrefslogtreecommitdiff
path: root/sys/src/cmd/nusb/serial/ftdi.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2017-04-01 22:19:58 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2017-04-01 22:19:58 +0200
commite0087b2a78d7229d8d2b148b8def688be6639797 (patch)
tree9b9f1a6a0939586a58251a9c89c3976f797ae07b /sys/src/cmd/nusb/serial/ftdi.c
parent25725eb0adc6902318e63da0eca9123be4d4f93d (diff)
nusb/lib: make usbcmd() return value symmetic; returning size of data phase (if any) (thanks aiju)
usbcmd() with Rh2d used to return the command size (8+ndata) wile returning only ndata for Rd2h. this changes it to always return ndata for Rh2d. it mostly doesnt matter as Rh2d callers only check r < 0 for error, but this makes the interface symmetic.
Diffstat (limited to 'sys/src/cmd/nusb/serial/ftdi.c')
-rw-r--r--sys/src/cmd/nusb/serial/ftdi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/src/cmd/nusb/serial/ftdi.c b/sys/src/cmd/nusb/serial/ftdi.c
index 3affcf39f..cbe0d035e 100644
--- a/sys/src/cmd/nusb/serial/ftdi.c
+++ b/sys/src/cmd/nusb/serial/ftdi.c
@@ -858,7 +858,7 @@ ftdiread(Serialport *p, int index, int req, uchar *buf, int len)
index |= p->interfc + 1;
dsprint(2, "serial: ftdiread %#p [%d] req: %#x val: %#x idx:%d buf:%p len:%d\n",
p, p->interfc, req, 0, index, buf, len);
- res = usbcmd(ser->dev, Rd2h | Rftdireq | Rdev, req, 0, index, buf, len);
+ res = usbcmd(ser->dev, Rd2h | Rftdireq | Rdev, req, 0, index, buf, len);
dsprint(2, "serial: ftdiread res:%d\n", res);
return res;
}