Signed-off-by: Tushar Behera tushar.behera@linaro.org --- drivers/usb/gadget/android.c | 7 ++++--- drivers/usb/gadget/composite.c | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/gadget/android.c b/drivers/usb/gadget/android.c index c26d7be..2b11055 100644 --- a/drivers/usb/gadget/android.c +++ b/drivers/usb/gadget/android.c @@ -1175,6 +1175,7 @@ static struct usb_composite_driver android_usb_driver = { .name = "android_usb", .dev = &device_desc, .strings = dev_strings, + .bind = android_bind, .unbind = android_usb_unbind, .max_speed = USB_SPEED_HIGH, }; @@ -1291,10 +1292,10 @@ static int __init init(void) _android_dev = dev;
/* Override composite driver functions */ - composite_driver.setup = android_setup; - composite_driver.disconnect = android_disconnect; + composite_driver_template.setup = android_setup; + composite_driver_template.disconnect = android_disconnect;
- return usb_composite_probe(&android_usb_driver, android_bind); + return usb_composite_probe(&android_usb_driver); } module_init(init);
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 957f973..c4460a5 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -1528,8 +1528,11 @@ composite_resume(struct usb_gadget *gadget) }
/*-------------------------------------------------------------------------*/ - +#if IS_ENABLED(CONFIG_USB_G_ANDROID) +static struct usb_gadget_driver composite_driver_template = { +#else static const struct usb_gadget_driver composite_driver_template = { +#endif .bind = composite_bind, .unbind = composite_unbind,