diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2012-09-06 20:11:16 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-09-10 15:06:48 +0200 |
commit | e1f15ccbae40b55a4e2591373ea5f1808cf29855 (patch) | |
tree | 036c040b04bbd92523f9689f81edf29419dee46f /drivers/usb/gadget/webcam.c | |
parent | usb: gadget: make composite module options readonly only (diff) | |
download | linux-e1f15ccbae40b55a4e2591373ea5f1808cf29855.tar.xz linux-e1f15ccbae40b55a4e2591373ea5f1808cf29855.zip |
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/webcam.c')
-rw-r--r-- | drivers/usb/gadget/webcam.c | 21 |
1 files changed, 8 insertions, 13 deletions
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) /* Allocate string descriptor numbers ... note that string contents * can be overridden by the composite_dev glue. */ - if ((ret = usb_string_id(cdev)) < 0) + ret = usb_string_ids_tab(cdev, webcam_strings); + if (ret < 0) goto error; - webcam_strings[STRING_MANUFACTURER_IDX].id = ret; - webcam_device_descriptor.iManufacturer = ret; - - if ((ret = usb_string_id(cdev)) < 0) - goto error; - webcam_strings[STRING_PRODUCT_IDX].id = ret; - webcam_device_descriptor.iProduct = ret; - - if ((ret = usb_string_id(cdev)) < 0) - goto error; - webcam_strings[STRING_DESCRIPTION_IDX].id = ret; - webcam_config_driver.iConfiguration = ret; + webcam_device_descriptor.iManufacturer = + webcam_strings[STRING_MANUFACTURER_IDX].id; + webcam_device_descriptor.iProduct = + webcam_strings[STRING_PRODUCT_IDX].id; + webcam_config_driver.iConfiguration = + webcam_strings[STRING_DESCRIPTION_IDX].id; /* Register our configuration. */ if ((ret = usb_add_config(cdev, &webcam_config_driver, |