ASoC: twl6040: Simplify custom put_volsw callback

Return -EINVAL in the unlikely event, if the function has been called
for unhandled control. This way we can remove one check in the code.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
Peter Ujfalusi 2011-10-04 14:39:42 +03:00 коммит произвёл Mark Brown
Родитель cdffa775e7
Коммит bfd3d4e9fb
1 изменённых файлов: 5 добавлений и 7 удалений

Просмотреть файл

@ -759,15 +759,13 @@ static int twl6040_put_volsw(struct snd_kcontrol *kcontrol,
out = &twl6040_priv->handsfree;
break;
default:
break;
return -EINVAL;
}
if (out) {
out->left_vol = ucontrol->value.integer.value[0];
out->right_vol = ucontrol->value.integer.value[1];
if (!out->active)
return 1;
}
out->left_vol = ucontrol->value.integer.value[0];
out->right_vol = ucontrol->value.integer.value[1];
if (!out->active)
return 1;
/* call the appropriate handler depending on the rreg */
if (mc->rreg)