From: Jaroslav Kysela Date: Tue, 19 Nov 2019 13:15:00 +0000 (+0100) Subject: ucm: quick fix for the previous commit when ALSA_CONFIG_UCM_VAR is set X-Git-Tag: android-x86-9.0-r1~9 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=2e53bbd876a6d02ab466b3e64a0da7e97638028f;p=android-x86%2Fexternal-alsa-lib.git ucm: quick fix for the previous commit when ALSA_CONFIG_UCM_VAR is set Signed-off-by: Jaroslav Kysela --- diff --git a/src/ucm/parser.c b/src/ucm/parser.c index 74608af9..f4fa8923 100644 --- a/src/ucm/parser.c +++ b/src/ucm/parser.c @@ -1584,20 +1584,21 @@ static int load_master_config(snd_use_case_mgr_t *uc_mgr, uc_mgr->conf_format = 2; configuration_filename(uc_mgr, filename, sizeof(filename), uc_mgr->conf_file_name, card_name, ".conf"); + if (access(filename, R_OK) == 0) + goto __load; } - if (uc_mgr->conf_format >= 2 && access(filename, R_OK) != 0) { - /* try the old ucm directory */ - uc_mgr->conf_format = 1; - configuration_filename(uc_mgr, filename, sizeof(filename), - card_name, card_name, ".conf"); - if (access(filename, R_OK) != 0) - return -ENOENT; - } + /* try the old ucm directory */ + uc_mgr->conf_format = 1; + configuration_filename(uc_mgr, filename, sizeof(filename), + card_name, card_name, ".conf"); + if (access(filename, R_OK) != 0) + return -ENOENT; } else { configuration_filename(uc_mgr, filename, sizeof(filename), card_name, card_name, ".conf"); } +__load: err = uc_mgr_config_load(uc_mgr->conf_format, filename, cfg); if (err < 0) { uc_error("error: could not parse configuration for card %s",