mixer: abst - reshuffle snd_mixer_simple_basic_register code to be more logical

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2025-11-12 10:20:21 +01:00
parent b97a11ecf0
commit f0679e5de2

View file

@ -305,7 +305,8 @@ int snd_mixer_simple_basic_register(snd_mixer_t *mixer,
file = s; file = s;
} }
err = snd_config_top(&top); err = snd_config_top(&top);
if (err >= 0) { if (err < 0)
goto __error;
err = snd_input_stdio_open(&input, file, "r"); err = snd_input_stdio_open(&input, file, "r");
if (err < 0) { if (err < 0) {
snd_error(MIXER, "unable to open simple mixer configuration file '%s'", file); snd_error(MIXER, "unable to open simple mixer configuration file '%s'", file);
@ -320,8 +321,6 @@ int snd_mixer_simple_basic_register(snd_mixer_t *mixer,
err = find_full(class, mixer, top, priv->device); err = find_full(class, mixer, top, priv->device);
if (err >= 0) if (err >= 0)
goto __full; goto __full;
}
if (err >= 0) {
err = snd_ctl_open(&priv->ctl, priv->device, 0); err = snd_ctl_open(&priv->ctl, priv->device, 0);
if (err < 0) { if (err < 0) {
snd_error(MIXER, "unable to open control device '%s': %s", priv->device, snd_strerror(err)); snd_error(MIXER, "unable to open control device '%s': %s", priv->device, snd_strerror(err));
@ -336,7 +335,6 @@ int snd_mixer_simple_basic_register(snd_mixer_t *mixer,
err = snd_ctl_card_info(priv->ctl, priv->info); err = snd_ctl_card_info(priv->ctl, priv->info);
if (err < 0) if (err < 0)
goto __error; goto __error;
}
if (err >= 0) if (err >= 0)
err = find_module(class, top); err = find_module(class, top);
if (err >= 0) if (err >= 0)