summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/nokia.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2012-09-06 20:11:16 +0200
committerFelipe Balbi <balbi@ti.com>2012-09-10 16:06:48 +0300
commite1f15ccbae40b55a4e2591373ea5f1808cf29855 (patch)
tree036c040b04bbd92523f9689f81edf29419dee46f /drivers/usb/gadget/nokia.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/nokia.c')
-rw-r--r--drivers/usb/gadget/nokia.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/drivers/usb/gadget/nokia.c b/drivers/usb/gadget/nokia.c
index 6834c6204df..b0893136a05 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)
if (status < 0)
goto err_ether;
- status = usb_string_id(cdev);
+ status = usb_string_ids_tab(cdev, strings_dev);
if (status < 0)
goto err_usb;
- strings_dev[STRING_MANUFACTURER_IDX].id = status;
-
- device_desc.iManufacturer = status;
-
- status = usb_string_id(cdev);
- if (status < 0)
- goto err_usb;
- strings_dev[STRING_PRODUCT_IDX].id = status;
-
- device_desc.iProduct = status;
-
- /* config description */
- status = usb_string_id(cdev);
- if (status < 0)
- goto err_usb;
- strings_dev[STRING_DESCRIPTION_IDX].id = status;
-
+ device_desc.iManufacturer = strings_dev[STRING_MANUFACTURER_IDX].id;
+ device_desc.iProduct = strings_dev[STRING_PRODUCT_IDX].id;
+ status = strings_dev[STRING_DESCRIPTION_IDX].id;
nokia_config_500ma_driver.iConfiguration = status;
nokia_config_100ma_driver.iConfiguration = status;