Revert "ALSA: hda: Add input value sanity checks to HDMI channel map controls"

This reverts commit 3cbe5cf67c.
This commit is contained in:
Ksawlii 2024-11-24 00:23:43 +01:00
parent 3e9c76f126
commit a4ead1e77a

View file

@ -753,20 +753,6 @@ static int hdmi_chmap_ctl_get(struct snd_kcontrol *kcontrol,
return 0; return 0;
} }
/* a simple sanity check for input values to chmap kcontrol */
static int chmap_value_check(struct hdac_chmap *hchmap,
const struct snd_ctl_elem_value *ucontrol)
{
int i;
for (i = 0; i < hchmap->channels_max; i++) {
if (ucontrol->value.integer.value[i] < 0 ||
ucontrol->value.integer.value[i] > SNDRV_CHMAP_LAST)
return -EINVAL;
}
return 0;
}
static int hdmi_chmap_ctl_put(struct snd_kcontrol *kcontrol, static int hdmi_chmap_ctl_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
@ -778,10 +764,6 @@ static int hdmi_chmap_ctl_put(struct snd_kcontrol *kcontrol,
unsigned char chmap[8], per_pin_chmap[8]; unsigned char chmap[8], per_pin_chmap[8];
int i, err, ca, prepared = 0; int i, err, ca, prepared = 0;
err = chmap_value_check(hchmap, ucontrol);
if (err < 0)
return err;
/* No monitor is connected in dyn_pcm_assign. /* No monitor is connected in dyn_pcm_assign.
* It's invalid to setup the chmap * It's invalid to setup the chmap
*/ */