From 79cd39543449827667b5633f349a82464edae891 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Wed, 5 Oct 2016 19:08:05 -0700 Subject: [PATCH] usb: gadget: f_mtp: Handle mtp os desc properly Currently mtp function driver is skipping function setup call back by not populating function pointer in function instance. Also, is_ptp flag is set incorrectly as true for mtp instance which would pass wrong os descriptor for mtp and ptp instance. Allow mtp driver to send os descriptor by populating function pointer in function instance and correctly set the is_ptp flag to pass valid os descriptors. Change-Id: Iec05a2f9309aba7d9ff81eca4ce683eff1590699 Signed-off-by: Hemant Kumar --- drivers/usb/gadget/function/f_mtp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_mtp.c b/drivers/usb/gadget/function/f_mtp.c index aa186781ef22..5e50fe245a59 100644 --- a/drivers/usb/gadget/function/f_mtp.c +++ b/drivers/usb/gadget/function/f_mtp.c @@ -1876,7 +1876,8 @@ struct usb_function *function_alloc_mtp_ptp(struct usb_function_instance *fi, dev->function.disable = mtp_function_disable; dev->function.setup = mtp_ctrlreq_configfs; dev->function.free_func = mtp_free; - dev->is_ptp = mtp_config; + dev->is_ptp = !mtp_config; + fi->f = &dev->function; return &dev->function; }