Revert "usb/gadget: f_mass_storage: use fsg_common_set_inquiry_string in fsg_common_init"
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Tue, 14 Jan 2014 13:27:01 +0000 (14:27 +0100)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:46:13 +0000 (11:46 +0900)
This reverts commit 2e9cc80a04c3f5c46640f7a4d347ce37c6f26953.

drivers/usb/gadget/f_mass_storage.c

index fcc6409..41a94a1 100644 (file)
@@ -2999,7 +2999,7 @@ struct fsg_common *fsg_common_init(struct fsg_common *common,
                                   struct usb_composite_dev *cdev,
                                   struct fsg_config *cfg)
 {
-       int rc;
+       int i, rc;
 
        common = fsg_common_setup(common, !!common);
        if (IS_ERR(common))
@@ -3029,9 +3029,16 @@ struct fsg_common *fsg_common_init(struct fsg_common *common,
        if (rc)
                goto error_release;
 
+       /* Prepare inquiryString */
+       i = get_default_bcdDevice();
+       snprintf(common->inquiry_string, sizeof common->inquiry_string,
+                "%-8s%-16s%04x", cfg->vendor_name ?: "Linux",
+                /* Assume product name dependent on the first LUN */
+                cfg->product_name ?: ((*common->luns)->cdrom
+                                    ? "File-CD Gadget"
+                                    : "File-Stor Gadget"),
+                i);
 
-       fsg_common_set_inquiry_string(common, cfg->vendor_name,
-                                     cfg->product_name);
        /* Tell the thread to start working */
        common->thread_task =
                kthread_create(fsg_main_thread, common, "file-storage");