aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/f_mass_storage.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/f_mass_storage.c')
-rw-r--r--drivers/usb/gadget/f_mass_storage.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index 6a67e2ed75d9..93a26b365e6a 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -2980,11 +2980,27 @@ fail:
2980 return rc; 2980 return rc;
2981} 2981}
2982 2982
2983void fsg_common_set_inquiry_string(struct fsg_common *common, const char *vn,
2984 const char *pn)
2985{
2986 int i;
2987
2988 /* Prepare inquiryString */
2989 i = get_default_bcdDevice();
2990 snprintf(common->inquiry_string, sizeof(common->inquiry_string),
2991 "%-8s%-16s%04x", vn ?: "Linux",
2992 /* Assume product name dependent on the first LUN */
2993 pn ?: ((*common->luns)->cdrom
2994 ? "File-CD Gadget"
2995 : "File-Stor Gadget"),
2996 i);
2997}
2998
2983struct fsg_common *fsg_common_init(struct fsg_common *common, 2999struct fsg_common *fsg_common_init(struct fsg_common *common,
2984 struct usb_composite_dev *cdev, 3000 struct usb_composite_dev *cdev,
2985 struct fsg_config *cfg) 3001 struct fsg_config *cfg)
2986{ 3002{
2987 int i, rc; 3003 int rc;
2988 3004
2989 common = fsg_common_setup(common); 3005 common = fsg_common_setup(common);
2990 if (IS_ERR(common)) 3006 if (IS_ERR(common))
@@ -3013,16 +3029,9 @@ struct fsg_common *fsg_common_init(struct fsg_common *common,
3013 if (rc) 3029 if (rc)
3014 goto error_release; 3030 goto error_release;
3015 3031
3016 /* Prepare inquiryString */
3017 i = get_default_bcdDevice();
3018 snprintf(common->inquiry_string, sizeof common->inquiry_string,
3019 "%-8s%-16s%04x", cfg->vendor_name ?: "Linux",
3020 /* Assume product name dependent on the first LUN */
3021 cfg->product_name ?: ((*common->luns)->cdrom
3022 ? "File-CD Gadget"
3023 : "File-Stor Gadget"),
3024 i);
3025 3032
3033 fsg_common_set_inquiry_string(common, cfg->vendor_name,
3034 cfg->product_name);
3026 /* Tell the thread to start working */ 3035 /* Tell the thread to start working */
3027 common->thread_task = 3036 common->thread_task =
3028 kthread_create(fsg_main_thread, common, "file-storage"); 3037 kthread_create(fsg_main_thread, common, "file-storage");