aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/serial.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2012-09-06 14:11:16 -0400
committerFelipe Balbi <balbi@ti.com>2012-09-10 09:06:48 -0400
commite1f15ccbae40b55a4e2591373ea5f1808cf29855 (patch)
tree036c040b04bbd92523f9689f81edf29419dee46f /drivers/usb/gadget/serial.c
parent72258493ec4f77a772d05a8df5ee663e1e24154b (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/serial.c')
-rw-r--r--drivers/usb/gadget/serial.c22
1 files changed, 4 insertions, 18 deletions
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 */