aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-10-20 11:55:46 -0700
committerArve Hjønnevåg <arve@android.com>2011-11-17 17:51:18 -0800
commit83770db8f54dd13e1c7bdb441cdd20e49849281a (patch)
tree0952c4ce008bab6460e11e163fa36dfcf3d21d47 /sound
parentb789a8d3becbcf6af949745d867cd0491404729d (diff)
downloadkernel_samsung_crespo-83770db8f54dd13e1c7bdb441cdd20e49849281a.zip
kernel_samsung_crespo-83770db8f54dd13e1c7bdb441cdd20e49849281a.tar.gz
kernel_samsung_crespo-83770db8f54dd13e1c7bdb441cdd20e49849281a.tar.bz2
ASoC: Simplify samsung_wm8994 mic path setting
- Only have one call to universal_mic_path(). - Use a switch statement rather than cascaded if () statements for clarity. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rwxr-xr-xsound/soc/codecs/wm8994_samsung.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/sound/soc/codecs/wm8994_samsung.c b/sound/soc/codecs/wm8994_samsung.c
index 7eadc6a..3b96452 100755
--- a/sound/soc/codecs/wm8994_samsung.c
+++ b/sound/soc/codecs/wm8994_samsung.c
@@ -297,16 +297,19 @@ static int wm8994_set_mic_path(struct snd_kcontrol *kcontrol,
wm8994->codec_state |= CAPTURE_ACTIVE;
- if (ucontrol->value.integer.value[0] == 0)
+ switch (ucontrol->value.integer.value[0]) {
+ case 0:
wm8994->rec_path = MAIN;
- else if (ucontrol->value.integer.value[0] == 1)
- wm8994->rec_path = SUB;
- else if (ucontrol->value.integer.value[0] == 2) {
+ break;
+ case 1:
+ wm8994->rec_path = SUB;
+ break;
+ case 2:
wm8994->rec_path = BT_REC;
- wm8994->universal_mic_path[wm8994->rec_path] (codec);
- return 0;
- } else
+ break;
+ default:
return -EINVAL;
+ }
wm8994->universal_mic_path[wm8994->rec_path] (codec);