aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/ncm.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/ncm.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/ncm.c')
-rw-r--r--drivers/usb/gadget/ncm.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/usb/gadget/ncm.c b/drivers/usb/gadget/ncm.c
index 1a26452ce4ca..343f3d364ef8 100644
--- a/drivers/usb/gadget/ncm.c
+++ b/drivers/usb/gadget/ncm.c
@@ -20,8 +20,6 @@
20/* #define VERBOSE_DEBUG */ 20/* #define VERBOSE_DEBUG */
21 21
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/utsname.h>
24
25 23
26#include "u_ether.h" 24#include "u_ether.h"
27 25
@@ -95,12 +93,9 @@ static const struct usb_descriptor_header *otg_desc[] = {
95 NULL, 93 NULL,
96}; 94};
97 95
98
99/* string IDs are assigned dynamically */ 96/* string IDs are assigned dynamically */
100static char manufacturer[50];
101
102static struct usb_string strings_dev[] = { 97static struct usb_string strings_dev[] = {
103 [USB_GADGET_MANUFACTURER_IDX].s = manufacturer, 98 [USB_GADGET_MANUFACTURER_IDX].s = "",
104 [USB_GADGET_PRODUCT_IDX].s = DRIVER_DESC, 99 [USB_GADGET_PRODUCT_IDX].s = DRIVER_DESC,
105 [USB_GADGET_SERIAL_IDX].s = "", 100 [USB_GADGET_SERIAL_IDX].s = "",
106 { } /* end of list */ 101 { } /* end of list */
@@ -169,15 +164,10 @@ static int __init gncm_bind(struct usb_composite_dev *cdev)
169 cpu_to_le16(0x0300 | 0x0099); 164 cpu_to_le16(0x0300 | 0x0099);
170 } 165 }
171 166
172
173 /* Allocate string descriptor numbers ... note that string 167 /* Allocate string descriptor numbers ... note that string
174 * contents can be overridden by the composite_dev glue. 168 * contents can be overridden by the composite_dev glue.
175 */ 169 */
176 170
177 /* device descriptor strings: manufacturer, product */
178 snprintf(manufacturer, sizeof manufacturer, "%s %s with %s",
179 init_utsname()->sysname, init_utsname()->release,
180 gadget->name);
181 status = usb_string_ids_tab(cdev, strings_dev); 171 status = usb_string_ids_tab(cdev, strings_dev);
182 if (status < 0) 172 if (status < 0)
183 goto fail; 173 goto fail;