Commit 807dccdb authored by Andrzej Pietrasiewicz's avatar Andrzej Pietrasiewicz Committed by Felipe Balbi

usb: gadget: f_uac1: use usb_gstrings_attach

Use the new usb_gstring_attach interface.
Tested-by: default avatarSebastian Reimers <sebastian.reimers@googlemail.com>
Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 605ef833
...@@ -664,6 +664,7 @@ f_audio_bind(struct usb_configuration *c, struct usb_function *f) ...@@ -664,6 +664,7 @@ f_audio_bind(struct usb_configuration *c, struct usb_function *f)
{ {
struct usb_composite_dev *cdev = c->cdev; struct usb_composite_dev *cdev = c->cdev;
struct f_audio *audio = func_to_audio(f); struct f_audio *audio = func_to_audio(f);
struct usb_string *us;
int status; int status;
struct usb_ep *ep = NULL; struct usb_ep *ep = NULL;
struct f_uac1_opts *audio_opts; struct f_uac1_opts *audio_opts;
...@@ -678,23 +679,17 @@ f_audio_bind(struct usb_configuration *c, struct usb_function *f) ...@@ -678,23 +679,17 @@ f_audio_bind(struct usb_configuration *c, struct usb_function *f)
return status; return status;
audio_opts->bound = true; audio_opts->bound = true;
} }
if (strings_uac1[0].id == 0) { us = usb_gstrings_attach(cdev, uac1_strings, ARRAY_SIZE(strings_uac1));
status = usb_string_ids_tab(c->cdev, strings_uac1); if (IS_ERR(us))
if (status < 0) return PTR_ERR(us);
goto fail; ac_interface_desc.iInterface = us[STR_AC_IF].id;
ac_interface_desc.iInterface = strings_uac1[STR_AC_IF].id; input_terminal_desc.iTerminal = us[STR_INPUT_TERMINAL].id;
input_terminal_desc.iTerminal = input_terminal_desc.iChannelNames = us[STR_INPUT_TERMINAL_CH_NAMES].id;
strings_uac1[STR_INPUT_TERMINAL].id; feature_unit_desc.iFeature = us[STR_FEAT_DESC_0].id;
input_terminal_desc.iChannelNames = output_terminal_desc.iTerminal = us[STR_OUTPUT_TERMINAL].id;
strings_uac1[STR_INPUT_TERMINAL_CH_NAMES].id; as_interface_alt_0_desc.iInterface = us[STR_AS_IF_ALT0].id;
feature_unit_desc.iFeature = strings_uac1[STR_FEAT_DESC_0].id; as_interface_alt_1_desc.iInterface = us[STR_AS_IF_ALT1].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;
}
f_audio_build_desc(audio); f_audio_build_desc(audio);
...@@ -815,7 +810,6 @@ static struct usb_function *f_audio_alloc(struct usb_function_instance *fi) ...@@ -815,7 +810,6 @@ static struct usb_function *f_audio_alloc(struct usb_function_instance *fi)
INIT_LIST_HEAD(&audio->play_queue); INIT_LIST_HEAD(&audio->play_queue);
spin_lock_init(&audio->lock); spin_lock_init(&audio->lock);
audio->card.func.strings = uac1_strings;
audio->card.func.bind = f_audio_bind; audio->card.func.bind = f_audio_bind;
audio->card.func.unbind = f_audio_unbind; audio->card.func.unbind = f_audio_unbind;
audio->card.func.set_alt = f_audio_set_alt; audio->card.func.set_alt = f_audio_set_alt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment