From f34a46e4b4a4008ac790256be7222d2da13415b2 Mon Sep 17 00:00:00 2001 From: Chandana Kishori Chiluveru Date: Thu, 28 Jun 2018 11:52:24 +0530 Subject: [PATCH] usb: gsi: Allocate strings IDs for functions on every bind Currently gsi driver calling usb_string_id() from bind() callbacks to allocate string IDs for functions and then store that ID in the appropriate descriptors and string table. This string_id will cleared from composite driver in unbind path. During composition switch when bind happens its checking previously allocated string_id for functions and doesn't allocating again a new staring_id. This will cause incorrect string_id assignment to usb functions and USB CV interface descriptor test failing with no strings for some compositions. Hence fix this issue by allocating string_ids upon every function bind. Change-Id: Icce114a770a13658614fc990e60670ef23044ba1 Signed-off-by: Chandana Kishori Chiluveru --- drivers/usb/gadget/function/f_gsi.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/usb/gadget/function/f_gsi.c b/drivers/usb/gadget/function/f_gsi.c index 4cbb23447d0e..8c5a2d09f84b 100644 --- a/drivers/usb/gadget/function/f_gsi.c +++ b/drivers/usb/gadget/function/f_gsi.c @@ -2600,10 +2600,6 @@ static int gsi_update_function_bind_params(struct f_gsi *gsi, struct usb_function *f = &gsi->function; int status; - /* maybe allocate device-global string IDs */ - if (info->string_defs[0].id != 0) - goto skip_string_id_alloc; - if (info->ctrl_str_idx >= 0 && info->ctrl_desc) { /* ctrl interface label */ status = usb_string_id(cdev); @@ -2640,7 +2636,6 @@ static int gsi_update_function_bind_params(struct f_gsi *gsi, info->cdc_eth_desc->iMACAddress = status; } -skip_string_id_alloc: if (info->ctrl_desc) info->ctrl_desc->bInterfaceNumber = gsi->ctrl_id;