f_audio_source: Use f_audiosource as first device name

Keep first instance name as f_audiosource and change name
for next intance as per number of instance.

Change-Id: I9888d10e1faceff16f950f20ac42261417f1d8e8
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
This commit is contained in:
Vijayavardhan Vennapusa 2017-05-25 12:45:36 +05:30
parent 5404e35069
commit 2d7a7965be

View file

@ -1029,8 +1029,14 @@ static struct usb_function_instance *audio_source_alloc_inst(void)
config_group_init_type_name(&fi_audio->func_inst.group, "",
&audio_source_func_type);
snprintf(device_name, AUDIO_SOURCE_DEV_NAME_LENGTH,
if (!count) {
snprintf(device_name, AUDIO_SOURCE_DEV_NAME_LENGTH,
"f_audio_source");
count++;
} else {
snprintf(device_name, AUDIO_SOURCE_DEV_NAME_LENGTH,
"f_audio_source%d", count++);
}
dev = create_function_device(device_name);