diff options
author | Andrzej Pietrasiewicz <andrzej.p@samsung.com> | 2014-07-22 19:58:41 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-08-20 14:05:10 -0500 |
commit | 807dccdba5c157c7131772bb6bd9a114a2ed9760 (patch) | |
tree | 8d85c5f1c33fae513f2b8f1c9a1228697eeaf28a /drivers/usb/gadget/function | |
parent | 605ef833f0c6f9e609e27ff1582a14a4dbc7d341 (diff) | |
download | linux-807dccdba5c157c7131772bb6bd9a114a2ed9760.tar.bz2 |
usb: gadget: f_uac1: use usb_gstrings_attach
Use the new usb_gstring_attach interface.
Tested-by: Sebastian Reimers <sebastian.reimers@googlemail.com>
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/function')
-rw-r--r-- | drivers/usb/gadget/function/f_uac1.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/drivers/usb/gadget/function/f_uac1.c b/drivers/usb/gadget/function/f_uac1.c index e0399d2aa818..34575375760e 100644 --- a/drivers/usb/gadget/function/f_uac1.c +++ b/drivers/usb/gadget/function/f_uac1.c @@ -664,6 +664,7 @@ f_audio_bind(struct usb_configuration *c, struct usb_function *f) { struct usb_composite_dev *cdev = c->cdev; struct f_audio *audio = func_to_audio(f); + struct usb_string *us; int status; struct usb_ep *ep = NULL; struct f_uac1_opts *audio_opts; @@ -678,23 +679,17 @@ f_audio_bind(struct usb_configuration *c, struct usb_function *f) return status; audio_opts->bound = true; } - if (strings_uac1[0].id == 0) { - status = usb_string_ids_tab(c->cdev, strings_uac1); - if (status < 0) - goto fail; - ac_interface_desc.iInterface = strings_uac1[STR_AC_IF].id; - input_terminal_desc.iTerminal = - strings_uac1[STR_INPUT_TERMINAL].id; - input_terminal_desc.iChannelNames = - strings_uac1[STR_INPUT_TERMINAL_CH_NAMES].id; - feature_unit_desc.iFeature = strings_uac1[STR_FEAT_DESC_0].id; - output_terminal_desc.iTerminal = - strings_uac1[STR_OUTPUT_TERMINAL].id; - as_interface_alt_0_desc.iInterface = - strings_uac1[STR_AS_IF_ALT0].id; - as_interface_alt_1_desc.iInterface = - strings_uac1[STR_AS_IF_ALT1].id; - } + us = usb_gstrings_attach(cdev, uac1_strings, ARRAY_SIZE(strings_uac1)); + if (IS_ERR(us)) + return PTR_ERR(us); + ac_interface_desc.iInterface = us[STR_AC_IF].id; + input_terminal_desc.iTerminal = us[STR_INPUT_TERMINAL].id; + input_terminal_desc.iChannelNames = us[STR_INPUT_TERMINAL_CH_NAMES].id; + feature_unit_desc.iFeature = us[STR_FEAT_DESC_0].id; + output_terminal_desc.iTerminal = us[STR_OUTPUT_TERMINAL].id; + as_interface_alt_0_desc.iInterface = us[STR_AS_IF_ALT0].id; + as_interface_alt_1_desc.iInterface = us[STR_AS_IF_ALT1].id; + f_audio_build_desc(audio); @@ -815,7 +810,6 @@ static struct usb_function *f_audio_alloc(struct usb_function_instance *fi) INIT_LIST_HEAD(&audio->play_queue); spin_lock_init(&audio->lock); - audio->card.func.strings = uac1_strings; audio->card.func.bind = f_audio_bind; audio->card.func.unbind = f_audio_unbind; audio->card.func.set_alt = f_audio_set_alt; |