aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/ether.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2012-09-10 09:01:58 -0400
committerFelipe Balbi <balbi@ti.com>2012-09-10 09:13:02 -0400
commitcc2683c318a5bf192b75cd5c343b51009db0cf6c (patch)
tree0ecbcd53bf42ab588208354fcabf7125d0d0a829 /drivers/usb/gadget/ether.c
parentd33f74fce3756d51a0203cec3d0d278e3b48d827 (diff)
usb: gadget: Provide a default implementation of default manufacturer string
Some gadgets provide custom entry here. Some may override it with an etntry that is also created by composite if there was no value sumbitted at all. This patch removes all "custom manufacturer" strings which are the same as these which are created by composite. Then it moves the creation of the default manufacturer string to usb_composite_overwrite_options() in case no command line argument has been used and the entry is still an empty string. By doing this we get rid of the global variable "composite_manufacturer" in composite. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/ether.c')
-rw-r--r--drivers/usb/gadget/ether.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index dd5e00d207fe..a5c272067625 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -14,8 +14,6 @@
14/* #define VERBOSE_DEBUG */ 14/* #define VERBOSE_DEBUG */
15 15
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/utsname.h>
18
19 17
20#if defined USB_ETH_RNDIS 18#if defined USB_ETH_RNDIS
21# undef USB_ETH_RNDIS 19# undef USB_ETH_RNDIS
@@ -193,11 +191,8 @@ static const struct usb_descriptor_header *otg_desc[] = {
193 NULL, 191 NULL,
194}; 192};
195 193
196/* string IDs are assigned dynamically */
197static char manufacturer[50];
198
199static struct usb_string strings_dev[] = { 194static struct usb_string strings_dev[] = {
200 [USB_GADGET_MANUFACTURER_IDX].s = manufacturer, 195 [USB_GADGET_MANUFACTURER_IDX].s = "",
201 [USB_GADGET_PRODUCT_IDX].s = PREFIX DRIVER_DESC, 196 [USB_GADGET_PRODUCT_IDX].s = PREFIX DRIVER_DESC,
202 [USB_GADGET_SERIAL_IDX].s = "", 197 [USB_GADGET_SERIAL_IDX].s = "",
203 { } /* end of list */ 198 { } /* end of list */
@@ -333,15 +328,10 @@ static int __init eth_bind(struct usb_composite_dev *cdev)
333 cpu_to_le16(0x0300 | 0x0099); 328 cpu_to_le16(0x0300 | 0x0099);
334 } 329 }
335 330
336
337 /* Allocate string descriptor numbers ... note that string 331 /* Allocate string descriptor numbers ... note that string
338 * contents can be overridden by the composite_dev glue. 332 * contents can be overridden by the composite_dev glue.
339 */ 333 */
340 334
341 /* device descriptor strings: manufacturer, product */
342 snprintf(manufacturer, sizeof manufacturer, "%s %s with %s",
343 init_utsname()->sysname, init_utsname()->release,
344 gadget->name);
345 status = usb_string_ids_tab(cdev, strings_dev); 335 status = usb_string_ids_tab(cdev, strings_dev);
346 if (status < 0) 336 if (status < 0)
347 goto fail; 337 goto fail;