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/gmidi.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/gmidi.c')
-rw-r--r-- | drivers/usb/gadget/gmidi.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/usb/gadget/gmidi.c b/drivers/usb/gadget/gmidi.c index 0c70708ef80f..68f8c032ba6b 100644 --- a/drivers/usb/gadget/gmidi.c +++ b/drivers/usb/gadget/gmidi.c | |||
@@ -140,25 +140,12 @@ static int __init midi_bind(struct usb_composite_dev *cdev) | |||
140 | struct usb_gadget *gadget = cdev->gadget; | 140 | struct usb_gadget *gadget = cdev->gadget; |
141 | int gcnum, status; | 141 | int gcnum, status; |
142 | 142 | ||
143 | status = usb_string_id(cdev); | 143 | status = usb_string_ids_tab(cdev, strings_dev); |
144 | if (status < 0) | 144 | if (status < 0) |
145 | return status; | 145 | return status; |
146 | strings_dev[STRING_MANUFACTURER_IDX].id = status; | 146 | device_desc.iManufacturer = strings_dev[STRING_MANUFACTURER_IDX].id; |
147 | device_desc.iManufacturer = status; | 147 | device_desc.iProduct = strings_dev[STRING_PRODUCT_IDX].id; |
148 | 148 | midi_config.iConfiguration = strings_dev[STRING_DESCRIPTION_IDX].id; | |
149 | status = usb_string_id(cdev); | ||
150 | if (status < 0) | ||
151 | return status; | ||
152 | strings_dev[STRING_PRODUCT_IDX].id = status; | ||
153 | device_desc.iProduct = status; | ||
154 | |||
155 | /* config description */ | ||
156 | status = usb_string_id(cdev); | ||
157 | if (status < 0) | ||
158 | return status; | ||
159 | strings_dev[STRING_DESCRIPTION_IDX].id = status; | ||
160 | |||
161 | midi_config.iConfiguration = status; | ||
162 | 149 | ||
163 | gcnum = usb_gadget_controller_number(gadget); | 150 | gcnum = usb_gadget_controller_number(gadget); |
164 | if (gcnum < 0) { | 151 | if (gcnum < 0) { |