summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2011-10-04 14:39:42 +0300
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-10-04 16:28:29 +0100
commitbfd3d4e9fbb9705181b821b478cc044911e47320 (patch)
tree1f22e4972d6ca5becb45fe67e55f5e32551a88c4 /sound
parentcdffa775e72de3a3d3ddccd04eb4eb94d58e84e6 (diff)
downloadop-kernel-dev-bfd3d4e9fbb9705181b821b478cc044911e47320.zip
op-kernel-dev-bfd3d4e9fbb9705181b821b478cc044911e47320.tar.gz
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>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/twl6040.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index d040905..8c740c1 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -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)
OpenPOWER on IntegriCloud