提交 bfd3d4e9 编写于 作者: P Peter Ujfalusi 提交者: Mark Brown

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: NPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 cdffa775
...@@ -759,15 +759,13 @@ static int twl6040_put_volsw(struct snd_kcontrol *kcontrol, ...@@ -759,15 +759,13 @@ static int twl6040_put_volsw(struct snd_kcontrol *kcontrol,
out = &twl6040_priv->handsfree; out = &twl6040_priv->handsfree;
break; break;
default: default:
break; return -EINVAL;
} }
if (out) { out->left_vol = ucontrol->value.integer.value[0];
out->left_vol = ucontrol->value.integer.value[0]; out->right_vol = ucontrol->value.integer.value[1];
out->right_vol = ucontrol->value.integer.value[1]; if (!out->active)
if (!out->active) return 1;
return 1;
}
/* call the appropriate handler depending on the rreg */ /* call the appropriate handler depending on the rreg */
if (mc->rreg) if (mc->rreg)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册