Commit 1c958b2b authored by Bjorn Andersson's avatar Bjorn Andersson
Browse files

usb: Silence usb helpers



It's perfectly normal to "poll" for incoming messages, so silence the
warning printout in the usb accessor functions.

Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent 5ec4f210
......@@ -343,18 +343,13 @@ found:
int qdl_read(struct qdl_device *qdl, void *buf, size_t len, unsigned int timeout)
{
struct usbdevfs_bulktransfer bulk = {};
int n;
bulk.ep = qdl->in_ep;
bulk.len = len;
bulk.data = buf;
bulk.timeout = timeout;
n = ioctl(qdl->fd, USBDEVFS_BULK, &bulk);
if (n < 0)
warn("receive usb bulk transfer failed");
return n;
return ioctl(qdl->fd, USBDEVFS_BULK, &bulk);
}
int qdl_write(struct qdl_device *qdl, const void *buf, size_t len, bool eot)
......@@ -370,7 +365,7 @@ int qdl_write(struct qdl_device *qdl, const void *buf, size_t len, bool eot)
ret = ioctl(qdl->fd, USBDEVFS_BULK, &bulk);
if (ret < 0)
warn("transmit usb bulk transfer failed");
return ret;
if (eot && (len % qdl->out_maxpktsize) == 0) {
bulk.ep = qdl->out_ep;
......@@ -380,7 +375,7 @@ int qdl_write(struct qdl_device *qdl, const void *buf, size_t len, bool eot)
n = ioctl(qdl->fd, USBDEVFS_BULK, &bulk);
if (n < 0)
warn("transmit zlp failed");
return n;
}
return ret;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment