diff options
-rw-r--r-- | drivers/usb/gadget/acm_ms.c | 12 | ||||
-rw-r--r-- | drivers/usb/gadget/audio.c | 12 | ||||
-rw-r--r-- | drivers/usb/gadget/cdc2.c | 12 | ||||
-rw-r--r-- | drivers/usb/gadget/ether.c | 12 | ||||
-rw-r--r-- | drivers/usb/gadget/gmidi.c | 21 | ||||
-rw-r--r-- | drivers/usb/gadget/hid.c | 11 | ||||
-rw-r--r-- | drivers/usb/gadget/ncm.c | 12 | ||||
-rw-r--r-- | drivers/usb/gadget/nokia.c | 22 | ||||
-rw-r--r-- | drivers/usb/gadget/serial.c | 22 | ||||
-rw-r--r-- | drivers/usb/gadget/webcam.c | 21 | ||||
-rw-r--r-- | drivers/usb/gadget/zero.c | 26 |
11 files changed, 46 insertions, 137 deletions
diff --git a/drivers/usb/gadget/acm_ms.c b/drivers/usb/gadget/acm_ms.c index 5db661d8590b..ea349bab7f15 100644 --- a/drivers/usb/gadget/acm_ms.c +++ b/drivers/usb/gadget/acm_ms.c | |||
@@ -192,17 +192,11 @@ static int __init acm_ms_bind(struct usb_composite_dev *cdev) | |||
192 | snprintf(manufacturer, sizeof manufacturer, "%s %s with %s", | 192 | snprintf(manufacturer, sizeof manufacturer, "%s %s with %s", |
193 | init_utsname()->sysname, init_utsname()->release, | 193 | init_utsname()->sysname, init_utsname()->release, |
194 | gadget->name); | 194 | gadget->name); |
195 | status = usb_string_id(cdev); | 195 | status = usb_string_ids_tab(cdev, strings_dev); |
196 | if (status < 0) | 196 | if (status < 0) |
197 | goto fail1; | 197 | goto fail1; |
198 | strings_dev[STRING_MANUFACTURER_IDX].id = status; | 198 | device_desc.iManufacturer = strings_dev[STRING_MANUFACTURER_IDX].id; |
199 | device_desc.iManufacturer = status; | 199 | device_desc.iProduct = strings_dev[STRING_PRODUCT_IDX].id; |
200 | |||
201 | status = usb_string_id(cdev); | ||
202 | if (status < 0) | ||
203 | goto fail1; | ||
204 | strings_dev[STRING_PRODUCT_IDX].id = status; | ||
205 | device_desc.iProduct = status; | ||
206 | 200 | ||
207 | /* register our configuration */ | 201 | /* register our configuration */ |
208 | status = usb_add_config(cdev, &acm_ms_config_driver, acm_ms_do_config); | 202 | status = usb_add_config(cdev, &acm_ms_config_driver, acm_ms_do_config); |
diff --git a/drivers/usb/gadget/audio.c b/drivers/usb/gadget/audio.c index 689d1422a1c0..5702ce3777fb 100644 --- a/drivers/usb/gadget/audio.c +++ b/drivers/usb/gadget/audio.c | |||
@@ -165,17 +165,11 @@ static int __init audio_bind(struct usb_composite_dev *cdev) | |||
165 | snprintf(manufacturer, sizeof manufacturer, "%s %s with %s", | 165 | snprintf(manufacturer, sizeof manufacturer, "%s %s with %s", |
166 | init_utsname()->sysname, init_utsname()->release, | 166 | init_utsname()->sysname, init_utsname()->release, |
167 | cdev->gadget->name); | 167 | cdev->gadget->name); |
168 | status = usb_string_id(cdev); | 168 | status = usb_string_ids_tab(cdev, strings_dev); |
169 | if (status < 0) | 169 | if (status < 0) |
170 | goto fail; | 170 | goto fail; |
171 | strings_dev[STRING_MANUFACTURER_IDX].id = status; | 171 | device_desc.iManufacturer = strings_dev[STRING_MANUFACTURER_IDX].id; |
172 | device_desc.iManufacturer = status; | 172 | device_desc.iProduct = strings_dev[STRING_PRODUCT_IDX].id; |
173 | |||
174 | status = usb_string_id(cdev); | ||
175 | if (status < 0) | ||
176 | goto fail; | ||
177 | strings_dev[STRING_PRODUCT_IDX].id = status; | ||
178 | device_desc.iProduct = status; | ||
179 | 173 | ||
180 | status = usb_add_config(cdev, &audio_config_driver, audio_do_config); | 174 | status = usb_add_config(cdev, &audio_config_driver, audio_do_config); |
181 | if (status < 0) | 175 | if (status < 0) |
diff --git a/drivers/usb/gadget/cdc2.c b/drivers/usb/gadget/cdc2.c index 8e386cf377a5..3b89fe2bd0b8 100644 --- a/drivers/usb/gadget/cdc2.c +++ b/drivers/usb/gadget/cdc2.c | |||
@@ -193,17 +193,11 @@ static int __init cdc_bind(struct usb_composite_dev *cdev) | |||
193 | snprintf(manufacturer, sizeof manufacturer, "%s %s with %s", | 193 | snprintf(manufacturer, sizeof manufacturer, "%s %s with %s", |
194 | init_utsname()->sysname, init_utsname()->release, | 194 | init_utsname()->sysname, init_utsname()->release, |
195 | gadget->name); | 195 | gadget->name); |
196 | status = usb_string_id(cdev); | 196 | status = usb_string_ids_tab(cdev, strings_dev); |
197 | if (status < 0) | 197 | if (status < 0) |
198 | goto fail1; | 198 | goto fail1; |
199 | strings_dev[STRING_MANUFACTURER_IDX].id = status; | 199 | device_desc.iManufacturer = strings_dev[STRING_MANUFACTURER_IDX].id; |
200 | device_desc.iManufacturer = status; | 200 | device_desc.iProduct = strings_dev[STRING_PRODUCT_IDX].id; |
201 | |||
202 | status = usb_string_id(cdev); | ||
203 | if (status < 0) | ||
204 | goto fail1; | ||
205 | strings_dev[STRING_PRODUCT_IDX].id = status; | ||
206 | device_desc.iProduct = status; | ||
207 | 201 | ||
208 | /* register our configuration */ | 202 | /* register our configuration */ |
209 | status = usb_add_config(cdev, &cdc_config_driver, cdc_do_config); | 203 | status = usb_add_config(cdev, &cdc_config_driver, cdc_do_config); |
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index 39eb718f796a..004c6ed79e3b 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c | |||
@@ -345,17 +345,11 @@ static int __init eth_bind(struct usb_composite_dev *cdev) | |||
345 | snprintf(manufacturer, sizeof manufacturer, "%s %s with %s", | 345 | snprintf(manufacturer, sizeof manufacturer, "%s %s with %s", |
346 | init_utsname()->sysname, init_utsname()->release, | 346 | init_utsname()->sysname, init_utsname()->release, |
347 | gadget->name); | 347 | gadget->name); |
348 | status = usb_string_id(cdev); | 348 | status = usb_string_ids_tab(cdev, strings_dev); |
349 | if (status < 0) | 349 | if (status < 0) |
350 | goto fail; | 350 | goto fail; |
351 | strings_dev[STRING_MANUFACTURER_IDX].id = status; | 351 | device_desc.iManufacturer = strings_dev[STRING_MANUFACTURER_IDX].id; |
352 | device_desc.iManufacturer = status; | 352 | device_desc.iProduct = strings_dev[STRING_PRODUCT_IDX].id; |
353 | |||
354 | status = usb_string_id(cdev); | ||
355 | if (status < 0) | ||
356 | goto fail; | ||
357 | strings_dev[STRING_PRODUCT_IDX].id = status; | ||
358 | device_desc.iProduct = status; | ||
359 | 353 | ||
360 | /* register our configuration(s); RNDIS first, if it's used */ | 354 | /* register our configuration(s); RNDIS first, if it's used */ |
361 | if (has_rndis()) { | 355 | if (has_rndis()) { |
diff --git a/drivers/usb/gadget/gmidi.c b/drivers/usb/gadget/gmidi.c index 0c70708ef80f..68f8c032ba6b 100644 --- a/drivers/usb/gadget/gmidi.c +++ b/drivers/usb/gadget/gmidi.c | |||
@@ -140,25 +140,12 @@ static int __init midi_bind(struct usb_composite_dev *cdev) | |||
140 | struct usb_gadget *gadget = cdev->gadget; | 140 | struct usb_gadget *gadget = cdev->gadget; |
141 | int gcnum, status; | 141 | int gcnum, status; |
142 | 142 | ||
143 | status = usb_string_id(cdev); | 143 | status = usb_string_ids_tab(cdev, strings_dev); |
144 | if (status < 0) | 144 | if (status < 0) |
145 | return status; | 145 | return status; |
146 | strings_dev[STRING_MANUFACTURER_IDX].id = status; | 146 | device_desc.iManufacturer = strings_dev[STRING_MANUFACTURER_IDX].id; |
147 | device_desc.iManufacturer = status; | 147 | device_desc.iProduct = strings_dev[STRING_PRODUCT_IDX].id; |
148 | 148 | midi_config.iConfiguration = strings_dev[STRING_DESCRIPTION_IDX].id; | |
149 | status = usb_string_id(cdev); | ||
150 | if (status < 0) | ||
151 | return status; | ||
152 | strings_dev[STRING_PRODUCT_IDX].id = status; | ||
153 | device_desc.iProduct = status; | ||
154 | |||
155 | /* config description */ | ||
156 | status = usb_string_id(cdev); | ||
157 | if (status < 0) | ||
158 | return status; | ||
159 | strings_dev[STRING_DESCRIPTION_IDX].id = status; | ||
160 | |||
161 | midi_config.iConfiguration = status; | ||
162 | 149 | ||
163 | gcnum = usb_gadget_controller_number(gadget); | 150 | gcnum = usb_gadget_controller_number(gadget); |
164 | if (gcnum < 0) { | 151 | if (gcnum < 0) { |
diff --git a/drivers/usb/gadget/hid.c b/drivers/usb/gadget/hid.c index 4880cdd9de43..1e3f03be94df 100644 --- a/drivers/usb/gadget/hid.c +++ b/drivers/usb/gadget/hid.c | |||
@@ -176,17 +176,12 @@ static int __init hid_bind(struct usb_composite_dev *cdev) | |||
176 | snprintf(manufacturer, sizeof manufacturer, "%s %s with %s", | 176 | snprintf(manufacturer, sizeof manufacturer, "%s %s with %s", |
177 | init_utsname()->sysname, init_utsname()->release, | 177 | init_utsname()->sysname, init_utsname()->release, |
178 | gadget->name); | 178 | gadget->name); |
179 | status = usb_string_id(cdev); | ||
180 | if (status < 0) | ||
181 | return status; | ||
182 | strings_dev[STRING_MANUFACTURER_IDX].id = status; | ||
183 | device_desc.iManufacturer = status; | ||
184 | 179 | ||
185 | status = usb_string_id(cdev); | 180 | status = usb_string_ids_tab(cdev, strings_dev); |
186 | if (status < 0) | 181 | if (status < 0) |
187 | return status; | 182 | return status; |
188 | strings_dev[STRING_PRODUCT_IDX].id = status; | 183 | device_desc.iManufacturer = strings_dev[STRING_MANUFACTURER_IDX].id; |
189 | device_desc.iProduct = status; | 184 | device_desc.iProduct = strings_dev[STRING_PRODUCT_IDX].id; |
190 | 185 | ||
191 | /* register our configuration */ | 186 | /* register our configuration */ |
192 | status = usb_add_config(cdev, &config_driver, do_config); | 187 | status = usb_add_config(cdev, &config_driver, do_config); |
diff --git a/drivers/usb/gadget/ncm.c b/drivers/usb/gadget/ncm.c index 69b660b79c09..6c7e15984535 100644 --- a/drivers/usb/gadget/ncm.c +++ b/drivers/usb/gadget/ncm.c | |||
@@ -180,17 +180,11 @@ static int __init gncm_bind(struct usb_composite_dev *cdev) | |||
180 | snprintf(manufacturer, sizeof manufacturer, "%s %s with %s", | 180 | snprintf(manufacturer, sizeof manufacturer, "%s %s with %s", |
181 | init_utsname()->sysname, init_utsname()->release, | 181 | init_utsname()->sysname, init_utsname()->release, |
182 | gadget->name); | 182 | gadget->name); |
183 | status = usb_string_id(cdev); | 183 | status = usb_string_ids_tab(cdev, strings_dev); |
184 | if (status < 0) | 184 | if (status < 0) |
185 | goto fail; | 185 | goto fail; |
186 | strings_dev[STRING_MANUFACTURER_IDX].id = status; | 186 | device_desc.iManufacturer = strings_dev[STRING_MANUFACTURER_IDX].id; |
187 | device_desc.iManufacturer = status; | 187 | device_desc.iProduct = strings_dev[STRING_PRODUCT_IDX].id; |
188 | |||
189 | status = usb_string_id(cdev); | ||
190 | if (status < 0) | ||
191 | goto fail; | ||
192 | strings_dev[STRING_PRODUCT_IDX].id = status; | ||
193 | device_desc.iProduct = status; | ||
194 | 188 | ||
195 | status = usb_add_config(cdev, &ncm_config_driver, | 189 | status = usb_add_config(cdev, &ncm_config_driver, |
196 | ncm_do_config); | 190 | ncm_do_config); |
diff --git a/drivers/usb/gadget/nokia.c b/drivers/usb/gadget/nokia.c index 6834c6204df3..b0893136a05d 100644 --- a/drivers/usb/gadget/nokia.c +++ b/drivers/usb/gadget/nokia.c | |||
@@ -164,26 +164,12 @@ static int __init nokia_bind(struct usb_composite_dev *cdev) | |||
164 | if (status < 0) | 164 | if (status < 0) |
165 | goto err_ether; | 165 | goto err_ether; |
166 | 166 | ||
167 | status = usb_string_id(cdev); | 167 | status = usb_string_ids_tab(cdev, strings_dev); |
168 | if (status < 0) | 168 | if (status < 0) |
169 | goto err_usb; | 169 | goto err_usb; |
170 | strings_dev[STRING_MANUFACTURER_IDX].id = status; | 170 | device_desc.iManufacturer = strings_dev[STRING_MANUFACTURER_IDX].id; |
171 | 171 | device_desc.iProduct = strings_dev[STRING_PRODUCT_IDX].id; | |
172 | device_desc.iManufacturer = status; | 172 | status = strings_dev[STRING_DESCRIPTION_IDX].id; |
173 | |||
174 | status = usb_string_id(cdev); | ||
175 | if (status < 0) | ||
176 | goto err_usb; | ||
177 | strings_dev[STRING_PRODUCT_IDX].id = status; | ||
178 | |||
179 | device_desc.iProduct = status; | ||
180 | |||
181 | /* config description */ | ||
182 | status = usb_string_id(cdev); | ||
183 | if (status < 0) | ||
184 | goto err_usb; | ||
185 | strings_dev[STRING_DESCRIPTION_IDX].id = status; | ||
186 | |||
187 | nokia_config_500ma_driver.iConfiguration = status; | 173 | nokia_config_500ma_driver.iConfiguration = status; |
188 | nokia_config_100ma_driver.iConfiguration = status; | 174 | nokia_config_100ma_driver.iConfiguration = status; |
189 | 175 | ||
diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c index 098c3d03dedd..9962504e14f1 100644 --- a/drivers/usb/gadget/serial.c +++ b/drivers/usb/gadget/serial.c | |||
@@ -175,26 +175,12 @@ static int __init gs_bind(struct usb_composite_dev *cdev) | |||
175 | snprintf(manufacturer, sizeof manufacturer, "%s %s with %s", | 175 | snprintf(manufacturer, sizeof manufacturer, "%s %s with %s", |
176 | init_utsname()->sysname, init_utsname()->release, | 176 | init_utsname()->sysname, init_utsname()->release, |
177 | gadget->name); | 177 | gadget->name); |
178 | status = usb_string_id(cdev); | 178 | status = usb_string_ids_tab(cdev, strings_dev); |
179 | if (status < 0) | 179 | if (status < 0) |
180 | goto fail; | 180 | goto fail; |
181 | strings_dev[STRING_MANUFACTURER_IDX].id = status; | 181 | device_desc.iManufacturer = strings_dev[STRING_MANUFACTURER_IDX].id; |
182 | 182 | device_desc.iProduct = strings_dev[STRING_PRODUCT_IDX].id; | |
183 | device_desc.iManufacturer = status; | 183 | status = strings_dev[STRING_DESCRIPTION_IDX].id; |
184 | |||
185 | status = usb_string_id(cdev); | ||
186 | if (status < 0) | ||
187 | goto fail; | ||
188 | strings_dev[STRING_PRODUCT_IDX].id = status; | ||
189 | |||
190 | device_desc.iProduct = status; | ||
191 | |||
192 | /* config description */ | ||
193 | status = usb_string_id(cdev); | ||
194 | if (status < 0) | ||
195 | goto fail; | ||
196 | strings_dev[STRING_DESCRIPTION_IDX].id = status; | ||
197 | |||
198 | serial_config_driver.iConfiguration = status; | 184 | serial_config_driver.iConfiguration = status; |
199 | 185 | ||
200 | /* set up other descriptors */ | 186 | /* set up other descriptors */ |
diff --git a/drivers/usb/gadget/webcam.c b/drivers/usb/gadget/webcam.c index 66dfca86b215..d44a4510a65a 100644 --- a/drivers/usb/gadget/webcam.c +++ b/drivers/usb/gadget/webcam.c | |||
@@ -355,20 +355,15 @@ webcam_bind(struct usb_composite_dev *cdev) | |||
355 | /* Allocate string descriptor numbers ... note that string contents | 355 | /* Allocate string descriptor numbers ... note that string contents |
356 | * can be overridden by the composite_dev glue. | 356 | * can be overridden by the composite_dev glue. |
357 | */ | 357 | */ |
358 | if ((ret = usb_string_id(cdev)) < 0) | 358 | ret = usb_string_ids_tab(cdev, webcam_strings); |
359 | if (ret < 0) | ||
359 | goto error; | 360 | goto error; |
360 | webcam_strings[STRING_MANUFACTURER_IDX].id = ret; | 361 | webcam_device_descriptor.iManufacturer = |
361 | webcam_device_descriptor.iManufacturer = ret; | 362 | webcam_strings[STRING_MANUFACTURER_IDX].id; |
362 | 363 | webcam_device_descriptor.iProduct = | |
363 | if ((ret = usb_string_id(cdev)) < 0) | 364 | webcam_strings[STRING_PRODUCT_IDX].id; |
364 | goto error; | 365 | webcam_config_driver.iConfiguration = |
365 | webcam_strings[STRING_PRODUCT_IDX].id = ret; | 366 | webcam_strings[STRING_DESCRIPTION_IDX].id; |
366 | webcam_device_descriptor.iProduct = ret; | ||
367 | |||
368 | if ((ret = usb_string_id(cdev)) < 0) | ||
369 | goto error; | ||
370 | webcam_strings[STRING_DESCRIPTION_IDX].id = ret; | ||
371 | webcam_config_driver.iConfiguration = ret; | ||
372 | 367 | ||
373 | /* Register our configuration. */ | 368 | /* Register our configuration. */ |
374 | if ((ret = usb_add_config(cdev, &webcam_config_driver, | 369 | if ((ret = usb_add_config(cdev, &webcam_config_driver, |
diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c index 9a9adee2911a..dbc336e3ba98 100644 --- a/drivers/usb/gadget/zero.c +++ b/drivers/usb/gadget/zero.c | |||
@@ -264,28 +264,18 @@ static int __init zero_bind(struct usb_composite_dev *cdev) | |||
264 | { | 264 | { |
265 | int gcnum; | 265 | int gcnum; |
266 | struct usb_gadget *gadget = cdev->gadget; | 266 | struct usb_gadget *gadget = cdev->gadget; |
267 | int id; | 267 | int status; |
268 | 268 | ||
269 | /* Allocate string descriptor numbers ... note that string | 269 | /* Allocate string descriptor numbers ... note that string |
270 | * contents can be overridden by the composite_dev glue. | 270 | * contents can be overridden by the composite_dev glue. |
271 | */ | 271 | */ |
272 | id = usb_string_id(cdev); | 272 | status = usb_string_ids_tab(cdev, strings_dev); |
273 | if (id < 0) | 273 | if (status < 0) |
274 | return id; | 274 | return status; |
275 | strings_dev[STRING_MANUFACTURER_IDX].id = id; | 275 | |
276 | device_desc.iManufacturer = id; | 276 | device_desc.iManufacturer = strings_dev[STRING_MANUFACTURER_IDX].id; |
277 | 277 | device_desc.iProduct = strings_dev[STRING_PRODUCT_IDX].id; | |
278 | id = usb_string_id(cdev); | 278 | device_desc.iSerialNumber = strings_dev[STRING_SERIAL_IDX].id; |
279 | if (id < 0) | ||
280 | return id; | ||
281 | strings_dev[STRING_PRODUCT_IDX].id = id; | ||
282 | device_desc.iProduct = id; | ||
283 | |||
284 | id = usb_string_id(cdev); | ||
285 | if (id < 0) | ||
286 | return id; | ||
287 | strings_dev[STRING_SERIAL_IDX].id = id; | ||
288 | device_desc.iSerialNumber = id; | ||
289 | 279 | ||
290 | setup_timer(&autoresume_timer, zero_autoresume, (unsigned long) cdev); | 280 | setup_timer(&autoresume_timer, zero_autoresume, (unsigned long) cdev); |
291 | 281 | ||