Re: [PATCH v2 15/21] usb/gadget: f_mass_storage: use fsg_common_set_inquiry_string in fsg_common_init
On Fri, Jul 19 2013, Andrzej Pietrasiewicz wrote: fsg_common_init is a lengthy function. Now there are helper functions which cover all parts of it. Use them. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com Acked-by: Michal Nazarewicz min...@mina86.com --- drivers/usb/gadget/f_mass_storage.c | 13 +++-- 1 files changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c index 3d4406a..94b7bc3 100644 --- a/drivers/usb/gadget/f_mass_storage.c +++ b/drivers/usb/gadget/f_mass_storage.c @@ -3000,7 +3000,7 @@ struct fsg_common *fsg_common_init(struct fsg_common *common, struct usb_composite_dev *cdev, struct fsg_config *cfg) { - int i, rc; + int rc; common = fsg_common_setup(common, !!common); if (IS_ERR(common)) @@ -3030,16 +3030,9 @@ 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); -- 1.7.0.4 -- Best regards, _ _ .o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o ..o | Computer Science, Michał “mina86” Nazarewicz(o o) ooo +email/xmpp: m...@google.com--ooO--(_)--Ooo-- signature.asc Description: PGP signature
[PATCH v2 15/21] usb/gadget: f_mass_storage: use fsg_common_set_inquiry_string in fsg_common_init
fsg_common_init is a lengthy function. Now there are helper functions which cover all parts of it. Use them. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com --- drivers/usb/gadget/f_mass_storage.c | 13 +++-- 1 files changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c index 3d4406a..94b7bc3 100644 --- a/drivers/usb/gadget/f_mass_storage.c +++ b/drivers/usb/gadget/f_mass_storage.c @@ -3000,7 +3000,7 @@ struct fsg_common *fsg_common_init(struct fsg_common *common, struct usb_composite_dev *cdev, struct fsg_config *cfg) { - int i, rc; + int rc; common = fsg_common_setup(common, !!common); if (IS_ERR(common)) @@ -3030,16 +3030,9 @@ 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); -- 1.7.0.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html