[alsa-devel] It seems return value of snd_soc_dapm_put_enum_double( ) is inverted
31 May
2018
31 May
'18
10:46 a.m.
Hi,
snd_soc_dapm_put_enum_double( ) returns 0 to indicate success; otherwise an error number. The value in the function is retrieved from dapm_kcontrol_set_value( ).
change = dapm_kcontrol_set_value(kcontrol, val);
However, dapm_kcontrol_set_value( ) returns a boolean.
static bool dapm_kcontrol_set_value(const struct snd_kcontrol *kcontrol, unsigned int value) { struct dapm_kcontrol_data *data = snd_kcontrol_chip(kcontrol);
if (data->value == value) return false; if (data->widget) data->widget->on_val = value; data->value = value; return true;
}
If the value has updated successfully, dapm_kcontrol_set_value( ) will return 1 and snd_soc_dapm_put_enum_double( ) will also return 1. The value is inverted.
2361
Age (days ago)
2361
Last active (days ago)
0 comments
1 participants
participants (1)
-
Tzung-Bi Shih