replace SNDMSG,SYSMSG,SNDERR,SYSERR with new log macros

... with interface identifiers

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2025-11-06 15:57:13 +01:00
parent 492df4bb94
commit 62c8e635dc
82 changed files with 1292 additions and 1201 deletions

View file

@ -54,30 +54,30 @@ static int snd_hwdep_open_conf(snd_hwdep_t **hwdep,
void *h = NULL;
if (snd_config_get_type(hwdep_conf) != SND_CONFIG_TYPE_COMPOUND) {
if (name)
SNDERR("Invalid type for HWDEP %s definition", name);
snd_error(HWDEP, "Invalid type for HWDEP %s definition", name);
else
SNDERR("Invalid type for HWDEP definition");
snd_error(HWDEP, "Invalid type for HWDEP definition");
return -EINVAL;
}
err = snd_config_search(hwdep_conf, "type", &conf);
if (err < 0) {
SNDERR("type is not defined");
snd_error(HWDEP, "type is not defined");
return err;
}
err = snd_config_get_id(conf, &id);
if (err < 0) {
SNDERR("unable to get id");
snd_error(HWDEP, "unable to get id");
return err;
}
err = snd_config_get_string(conf, &str);
if (err < 0) {
SNDERR("Invalid type for %s", id);
snd_error(HWDEP, "Invalid type for %s", id);
return err;
}
err = snd_config_search_definition(hwdep_root, "hwdep_type", str, &type_conf);
if (err >= 0) {
if (snd_config_get_type(type_conf) != SND_CONFIG_TYPE_COMPOUND) {
SNDERR("Invalid type for HWDEP type %s definition", str);
snd_error(HWDEP, "Invalid type for HWDEP type %s definition", str);
err = -EINVAL;
goto _err;
}
@ -91,7 +91,7 @@ static int snd_hwdep_open_conf(snd_hwdep_t **hwdep,
if (strcmp(id, "lib") == 0) {
err = snd_config_get_string(n, &lib);
if (err < 0) {
SNDERR("Invalid type for %s", id);
snd_error(HWDEP, "Invalid type for %s", id);
goto _err;
}
continue;
@ -99,12 +99,12 @@ static int snd_hwdep_open_conf(snd_hwdep_t **hwdep,
if (strcmp(id, "open") == 0) {
err = snd_config_get_string(n, &open_name);
if (err < 0) {
SNDERR("Invalid type for %s", id);
snd_error(HWDEP, "Invalid type for %s", id);
goto _err;
}
continue;
}
SNDERR("Unknown field %s", id);
snd_error(HWDEP, "Unknown field %s", id);
err = -EINVAL;
goto _err;
}
@ -121,10 +121,10 @@ static int snd_hwdep_open_conf(snd_hwdep_t **hwdep,
open_func = snd_dlsym(h, open_name, SND_DLSYM_VERSION(SND_HWDEP_DLSYM_VERSION));
err = 0;
if (!h) {
SNDERR("Cannot open shared library %s (%s)", lib, errbuf);
snd_error(HWDEP, "Cannot open shared library %s (%s)", lib, errbuf);
err = -ENOENT;
} else if (!open_func) {
SNDERR("symbol %s is not defined inside %s", open_name, lib);
snd_error(HWDEP, "symbol %s is not defined inside %s", open_name, lib);
snd_dlclose(h);
err = -ENXIO;
}
@ -148,7 +148,7 @@ static int snd_hwdep_open_noupdate(snd_hwdep_t **hwdep, snd_config_t *root, cons
snd_config_t *hwdep_conf;
err = snd_config_search_definition(root, "hwdep", name, &hwdep_conf);
if (err < 0) {
SNDERR("Unknown HwDep %s", name);
snd_error(HWDEP, "Unknown HwDep %s", name);
return err;
}
err = snd_hwdep_open_conf(hwdep, name, root, hwdep_conf, mode);

View file

@ -172,7 +172,7 @@ int _snd_hwdep_hw_open(snd_hwdep_t **hwdep, char *name,
return err;
continue;
}
SNDERR("Unexpected field %s", id);
snd_error(HWDEP, "Unexpected field %s", id);
return -EINVAL;
}
if (card < 0)