aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorMichal Nazarewicz <m.nazarewicz@samsung.com>2010-08-12 11:43:49 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-22 13:21:23 -0400
commita99d8a45bc2f495be45b8d417b795d7282a69091 (patch)
tree56ea460056d8ef92792af4b9133ee3d4e4bea397 /drivers/usb/gadget
parent7c2b61d02c384a0d5867e524ae72ad98ec2d33fd (diff)
USB: gadget: g_multi: moved strings handling code to composite
This patch removes some of the string registration from the Multifunction Composite Gadget as composite layer can handle the iManufacturer and iProduct for us. This also adds the "needs_serial" so that composite layer will issue a warning if user space fails to provide the iSerialNumber module parameter. Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/multi.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/drivers/usb/gadget/multi.c b/drivers/usb/gadget/multi.c
index 36d67a32abef..ca51661d71db 100644
--- a/drivers/usb/gadget/multi.c
+++ b/drivers/usb/gadget/multi.c
@@ -121,8 +121,6 @@ static const struct usb_descriptor_header *otg_desc[] = {
121 121
122 122
123enum { 123enum {
124 MULTI_STRING_MANUFACTURER_IDX,
125 MULTI_STRING_PRODUCT_IDX,
126#ifdef CONFIG_USB_G_MULTI_RNDIS 124#ifdef CONFIG_USB_G_MULTI_RNDIS
127 MULTI_STRING_RNDIS_CONFIG_IDX, 125 MULTI_STRING_RNDIS_CONFIG_IDX,
128#endif 126#endif
@@ -131,11 +129,7 @@ enum {
131#endif 129#endif
132}; 130};
133 131
134static char manufacturer[50];
135
136static struct usb_string strings_dev[] = { 132static struct usb_string strings_dev[] = {
137 [MULTI_STRING_MANUFACTURER_IDX].s = manufacturer,
138 [MULTI_STRING_PRODUCT_IDX].s = DRIVER_DESC,
139#ifdef CONFIG_USB_G_MULTI_RNDIS 133#ifdef CONFIG_USB_G_MULTI_RNDIS
140 [MULTI_STRING_RNDIS_CONFIG_IDX].s = "Multifunction with RNDIS", 134 [MULTI_STRING_RNDIS_CONFIG_IDX].s = "Multifunction with RNDIS",
141#endif 135#endif
@@ -314,20 +308,11 @@ static int __ref multi_bind(struct usb_composite_dev *cdev)
314 device_desc.bcdDevice = cpu_to_le16(0x0300 | 0x0099); 308 device_desc.bcdDevice = cpu_to_le16(0x0300 | 0x0099);
315 } 309 }
316 310
317 /* allocate string descriptor numbers */ 311 /* allocate string IDs */
318 snprintf(manufacturer, sizeof manufacturer, "%s %s with %s",
319 init_utsname()->sysname, init_utsname()->release,
320 gadget->name);
321
322 status = usb_string_ids_tab(cdev, strings_dev); 312 status = usb_string_ids_tab(cdev, strings_dev);
323 if (unlikely(status < 0)) 313 if (unlikely(status < 0))
324 goto fail2; 314 goto fail2;
325 315
326 device_desc.iManufacturer =
327 strings_dev[MULTI_STRING_MANUFACTURER_IDX].id;
328 device_desc.iProduct =
329 strings_dev[MULTI_STRING_PRODUCT_IDX].id;
330
331 /* register configurations */ 316 /* register configurations */
332 status = rndis_config_register(cdev); 317 status = rndis_config_register(cdev);
333 if (unlikely(status < 0)) 318 if (unlikely(status < 0))
@@ -370,6 +355,8 @@ static struct usb_composite_driver multi_driver = {
370 .strings = dev_strings, 355 .strings = dev_strings,
371 .bind = multi_bind, 356 .bind = multi_bind,
372 .unbind = __exit_p(multi_unbind), 357 .unbind = __exit_p(multi_unbind),
358 .iProduct = DRIVER_DESC,
359 .needs_serial = 1,
373}; 360};
374 361
375 362