usb/android gadget: limited ACM instances to 1
authorWu, Hao <hao.wu@intel.com>
Wed, 21 Dec 2011 15:33:13 +0000 (23:33 +0800)
committerbuildbot <buildbot@intel.com>
Tue, 27 Dec 2011 08:46:15 +0000 (00:46 -0800)
BZ: 17930

We don't have enough endpoints to support multi-instances ACM.

Change-Id: I7378f336ed22751b8255c3c8617d2740ca397cf3
Signed-off-by: Wu, Hao <hao.wu@intel.com>
Reviewed-on: http://android.intel.com:8080/29632
Reviewed-by: Zhuang, Jin Can <jin.can.zhuang@intel.com>
Reviewed-by: Tang, Richard <richard.tang@intel.com>
Reviewed-by: Meng, Zhe <zhe.meng@intel.com>
Tested-by: Meng, Zhe <zhe.meng@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/usb/gadget/android.c

index 74ff6fd..b1a31d9 100644 (file)
@@ -212,17 +212,22 @@ static struct android_usb_function adb_function = {
 };
 
 
-#define MAX_ACM_INSTANCES 4
+#define MAX_ACM_INSTANCES 1
 struct acm_function_config {
        int instances;
 };
 
 static int acm_function_init(struct android_usb_function *f, struct usb_composite_dev *cdev)
 {
+       struct acm_function_config      *config;
+
        f->config = kzalloc(sizeof(struct acm_function_config), GFP_KERNEL);
        if (!f->config)
                return -ENOMEM;
 
+       config = f->config;
+       config->instances = MAX_ACM_INSTANCES;
+
        return gserial_setup(cdev->gadget, MAX_ACM_INSTANCES);
 }