diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2012-09-06 14:11:16 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-09-10 09:06:48 -0400 |
commit | e1f15ccbae40b55a4e2591373ea5f1808cf29855 (patch) | |
tree | 036c040b04bbd92523f9689f81edf29419dee46f /drivers/usb/gadget/ether.c | |
parent | 72258493ec4f77a772d05a8df5ee663e1e24154b (diff) |
usb: gadget: use usb_string_ids_tab instead multiple usb_string_id()
Using usb_string_ids_tab() instead multiple calls of usb_string_id()
seems to be handy. It also allows to add string without many checks.
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.c | 12 |
1 files changed, 3 insertions, 9 deletions
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()) { |