ucm: Fix opening of master-configs by the card's longname
Prior to commit
aba2260ae7b5 ("ucm: switch to ucm2 directory and v2 format,
keep backward compatibility").
The filename build in parse_verb_file() was build like this:
<prefix>/<uc_mgr->conf_file_name>/<file>
Where uc_mgr->conf_file_name would contain either the card_name or the
card's longname depending on the detection of a longname based config in
uc_mgr_import_master_config().
While the filename used in load_master_config() was build like this:
<prefix>/<card_name>/<card_name>.conf
And uc_mgr_import_master_config() first calls load_master_config()
with the card's longname and if that succeeds it overwrites
uc_mgr->conf_file_name with the longname so that the subsequent uses
of uc_mgr->conf_file_name in parse_verb_file() correctly use the longname.
But the new configuration_filename() helper added in commit
aba2260ae7b5
_always_ builds the filename like this:
<prefix>/<uc_mgr->conf_file_name>/<file><suffix>
This breaks the loading of the master-config by its longname, as when
the longname is tried uc_mgr->conf_file_name still contains the card_name.
This commit fixes this by adding a dir parameter to configuration_filename()
and restoring the old behavior by passing card_name as dir in
load_master_config().
Fixes:
aba2260ae7b5 ("ucm: switch to ucm2 directory and v2 format, keep backward compatibility")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>