diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2012-09-10 09:01:58 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-09-10 09:13:02 -0400 |
commit | cc2683c318a5bf192b75cd5c343b51009db0cf6c (patch) | |
tree | 0ecbcd53bf42ab588208354fcabf7125d0d0a829 /drivers/usb/gadget/audio.c | |
parent | d33f74fce3756d51a0203cec3d0d278e3b48d827 (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/audio.c')
-rw-r--r-- | drivers/usb/gadget/audio.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/usb/gadget/audio.c b/drivers/usb/gadget/audio.c index 8857b6eeb6a2..1f81e0f4fab9 100644 --- a/drivers/usb/gadget/audio.c +++ b/drivers/usb/gadget/audio.c | |||
@@ -12,7 +12,6 @@ | |||
12 | /* #define VERBOSE_DEBUG */ | 12 | /* #define VERBOSE_DEBUG */ |
13 | 13 | ||
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/utsname.h> | ||
16 | #include <linux/usb/composite.h> | 15 | #include <linux/usb/composite.h> |
17 | 16 | ||
18 | #include "gadget_chips.h" | 17 | #include "gadget_chips.h" |
@@ -33,10 +32,8 @@ USB_GADGET_COMPOSITE_OPTIONS(); | |||
33 | 32 | ||
34 | /* string IDs are assigned dynamically */ | 33 | /* string IDs are assigned dynamically */ |
35 | 34 | ||
36 | static char manufacturer[50]; | ||
37 | |||
38 | static struct usb_string strings_dev[] = { | 35 | static struct usb_string strings_dev[] = { |
39 | [USB_GADGET_MANUFACTURER_IDX].s = manufacturer, | 36 | [USB_GADGET_MANUFACTURER_IDX].s = "", |
40 | [USB_GADGET_PRODUCT_IDX].s = DRIVER_DESC, | 37 | [USB_GADGET_PRODUCT_IDX].s = DRIVER_DESC, |
41 | [USB_GADGET_SERIAL_IDX].s = "", | 38 | [USB_GADGET_SERIAL_IDX].s = "", |
42 | { } /* end of list */ | 39 | { } /* end of list */ |
@@ -161,10 +158,6 @@ static int __init audio_bind(struct usb_composite_dev *cdev) | |||
161 | __constant_cpu_to_le16(0x0300 | 0x0099); | 158 | __constant_cpu_to_le16(0x0300 | 0x0099); |
162 | } | 159 | } |
163 | 160 | ||
164 | /* device descriptor strings: manufacturer, product */ | ||
165 | snprintf(manufacturer, sizeof manufacturer, "%s %s with %s", | ||
166 | init_utsname()->sysname, init_utsname()->release, | ||
167 | cdev->gadget->name); | ||
168 | status = usb_string_ids_tab(cdev, strings_dev); | 161 | status = usb_string_ids_tab(cdev, strings_dev); |
169 | if (status < 0) | 162 | if (status < 0) |
170 | goto fail; | 163 | goto fail; |