It seems return value of snd_soc_dapm_put_enum_double( ) is inverted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux