mirror of
https://github.com/openharmony/third_party_tinyalsa.git
synced 2026-07-19 23:33:30 -04:00
Revert "mixer: Control input value in mixer_ctl_set_value"
This reverts commit 0e07647e4b.
This commit disables reporting of an error when somebody requests an out
of range value from a control which seems like a bad goal to start with,
if something invalid is requested we should return an error not set
things to the nearest valid state.
Secondly since mixer_ctl_get_range_max returns an error for all control
types except TYPE_INTEGER, all controls that are not integers will be
set to -EINVAL with this patch included.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
This commit is contained in:
@@ -383,9 +383,6 @@ int mixer_ctl_set_value(struct mixer_ctl *ctl, unsigned int id, int value)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (value > mixer_ctl_get_range_max(ctl))
|
||||
value = mixer_ctl_get_range_max(ctl);
|
||||
|
||||
switch (ctl->info->type) {
|
||||
case SNDRV_CTL_ELEM_TYPE_BOOLEAN:
|
||||
ev.value.integer.value[id] = !!value;
|
||||
|
||||
Reference in New Issue
Block a user