USB: gadget: f_mtp: Don't block in mtp_send_event
authorMike Lockwood <lockwood@android.com>
Thu, 10 Feb 2011 16:54:53 +0000 (11:54 -0500)
committermgross <mark.gross@intel.com>
Wed, 9 Nov 2011 20:07:08 +0000 (12:07 -0800)
commitd202500fdccda5e409cadd8297813b57d61775b2
tree981ee7281a1a845ecf27f85ad5692392bdb2e08e
parentf6cee36f897dac2264b4bbee042117861c3391c5
USB: gadget: f_mtp: Don't block in mtp_send_event

We used to wait for the previous interrupt packet to complete before sending
the next packet.  But unfortunately the previous packet will not complete
until USB is disconnected if the host is not listening on the interrupt
endpoint (which is the case with libmtp on Linux and Mac).
To avoid hanging indefinitely in this case, we now simply return -EBUSY
if the previous interrupt packet has not completed yet.

Signed-off-by: Mike Lockwood <lockwood@android.com>
drivers/usb/gadget/f_mtp.c