OSDN Git Service

usb: gadget: mtp: reset string descriptor's index with unbind
authorMayank Rana <mrana@codeaurora.org>
Tue, 28 Mar 2017 22:17:03 +0000 (15:17 -0700)
committerGerrit - the friendly Code Review server <code-review@localhost>
Wed, 29 Mar 2017 23:53:21 +0000 (16:53 -0700)
commiteae2d6033f1f3aa46aeedbf6edb5a73f10f70528
tree968769ccb3cf01f1057492e5b6a27b0cb368371f
parent664cdd33f956accabebd29edba6c220b1580744d
usb: gadget: mtp: reset string descriptor's index with unbind

When USB host is re-enumerating USB MTP device multiple time, it
has been observed that USB MTP enumeration fails. USB MTP host
side environment (i.e. libmtp) is looking for USB MTP device to
pass string descriptor as "MTP" for successful enumeration. Due
to iInterface ID conflict, USB device is passing next interface
related string descriptor instead of USB MTP interface related
string descriptor. This results into no enumeration with USB MTP
configuration. Fix this issue by resetting mtp_string_defs string
descriptor id to zero, so next mtp_function_bind() call re-allocates
string ID.

CRs-Fixed: 2024744
Change-Id: Iad290ad480ccf23bd514a67128541d7ff67de1a5
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
drivers/usb/gadget/function/f_mtp.c