diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2012-09-10 15:01:58 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-09-10 15:13:02 +0200 |
commit | cc2683c318a5bf192b75cd5c343b51009db0cf6c (patch) | |
tree | 0ecbcd53bf42ab588208354fcabf7125d0d0a829 /drivers/usb/gadget/hid.c | |
parent | usb: gadget: remove string override from struct usb_composite_driver (diff) | |
download | linux-cc2683c318a5bf192b75cd5c343b51009db0cf6c.tar.xz linux-cc2683c318a5bf192b75cd5c343b51009db0cf6c.zip |
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/hid.c')
-rw-r--r-- | drivers/usb/gadget/hid.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/usb/gadget/hid.c b/drivers/usb/gadget/hid.c index 16caf50e916d..0e2e357cc59e 100644 --- a/drivers/usb/gadget/hid.c +++ b/drivers/usb/gadget/hid.c @@ -91,10 +91,8 @@ static const struct usb_descriptor_header *otg_desc[] = { /* string IDs are assigned dynamically */ -static char manufacturer[50]; - static struct usb_string strings_dev[] = { - [USB_GADGET_MANUFACTURER_IDX].s = manufacturer, + [USB_GADGET_MANUFACTURER_IDX].s = "", [USB_GADGET_PRODUCT_IDX].s = DRIVER_DESC, [USB_GADGET_SERIAL_IDX].s = "", { } /* end of list */ @@ -165,16 +163,10 @@ static int __init hid_bind(struct usb_composite_dev *cdev) else device_desc.bcdDevice = cpu_to_le16(0x0300 | 0x0099); - /* Allocate string descriptor numbers ... note that string * contents can be overridden by the composite_dev glue. */ - /* device descriptor strings: manufacturer, product */ - snprintf(manufacturer, sizeof manufacturer, "%s %s with %s", - init_utsname()->sysname, init_utsname()->release, - gadget->name); - status = usb_string_ids_tab(cdev, strings_dev); if (status < 0) return status; |