diff options
author | Mike Lockwood <lockwood@android.com> | 2011-02-14 08:07:50 -0500 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2011-02-14 08:17:44 -0500 |
commit | 126ea73dd1919c8a176019c50b1ca96035aef45b (patch) | |
tree | 0768699dd3e8b0b71cfe7857318527737d859462 /media/mtp | |
parent | 31af37320d29c8bc725d8b4fe97e2f0288818333 (diff) | |
download | frameworks_av-126ea73dd1919c8a176019c50b1ca96035aef45b.zip frameworks_av-126ea73dd1919c8a176019c50b1ca96035aef45b.tar.gz frameworks_av-126ea73dd1919c8a176019c50b1ca96035aef45b.tar.bz2 |
MTP host: Use usb_device_bulk_transfer for synchronous transfers
Change-Id: Icf42ea0e5a848cee1565da49713ee9ad0db9f1a6
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'media/mtp')
-rw-r--r-- | media/mtp/MtpPacket.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/media/mtp/MtpPacket.cpp b/media/mtp/MtpPacket.cpp index d3f2cb4..baf99e5 100644 --- a/media/mtp/MtpPacket.cpp +++ b/media/mtp/MtpPacket.cpp @@ -153,12 +153,13 @@ void MtpPacket::setParameter(int index, uint32_t value) { #ifdef MTP_HOST int MtpPacket::transfer(struct usb_request* request) { - if (usb_request_queue(request)) { - LOGE("usb_endpoint_queue failed, errno: %d", errno); - return -1; - } - request = usb_request_wait(request->dev); - return (request ? request->actual_length : -1); + int result = usb_device_bulk_transfer(request->dev, + request->endpoint, + request->buffer, + request->buffer_length, + 0); + request->actual_length = result; + return result; } #endif |