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/acm_ms.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/acm_ms.c')
-rw-r--r-- | drivers/usb/gadget/acm_ms.c | 12 |
1 files changed, 3 insertions, 9 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); |