ASoC: wcd: update handling of invalid cases

initialize return variable and add default case inside the
switch statement.

CRs-Fixed: 980968
Change-Id: If1fe566a8f88f1384826670220b8352310a3f996
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
This commit is contained in:
Yeleswarapu Nagaradhesh 2016-02-22 12:24:35 +05:30 committed by David Keitel
parent 3ad71a8681
commit b43518d9f5
3 changed files with 16 additions and 3 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -3265,7 +3265,7 @@ static int tomtom_codec_enable_dmic(struct snd_soc_dapm_widget *w,
static int tomtom_codec_config_mad(struct snd_soc_codec *codec)
{
int ret;
int ret = 0;
const struct firmware *fw;
struct firmware_cal *hwdep_cal = NULL;
struct mad_audio_cal *mad_cal;

View file

@ -8126,7 +8126,8 @@ static int tasha_config_compander(struct snd_soc_codec *codec, int interp_n,
static int tasha_codec_config_mad(struct snd_soc_codec *codec)
{
int ret, idx;
int ret = 0;
int idx;
const struct firmware *fw;
struct firmware_cal *hwdep_cal = NULL;
struct wcd_mad_audio_cal *mad_cal = NULL;
@ -10730,6 +10731,8 @@ static int tasha_hw_params(struct snd_pcm_substream *substream,
tasha->dai[dai->id].bit_width = 24;
i2s_bit_mode = 0x00;
break;
default:
return -EINVAL;
}
tasha->dai[dai->id].rate = params_rate(params);
if (tasha->intf_type == WCD9XXX_INTERFACE_TYPE_I2C) {
@ -11329,6 +11332,8 @@ static ssize_t tasha_codec_version_read(struct snd_info_entry *entry,
len = snprintf(buffer, sizeof(buffer), "WCD9335_1_0\n");
else if (TASHA_IS_1_1(wcd9xxx->version))
len = snprintf(buffer, sizeof(buffer), "WCD9335_1_1\n");
else
snprintf(buffer, sizeof(buffer), "VER_UNDEFINED\n");
} else if (wcd9xxx->codec_type->id_major == TASHA2P0_MAJOR) {
len = snprintf(buffer, sizeof(buffer), "WCD9335_2_0\n");
} else

View file

@ -284,6 +284,8 @@ static void wcd_clsh_set_gain_path(struct snd_soc_codec *codec,
case CLS_H_LP:
val = 0x01;
break;
default:
return;
};
snd_soc_update_bits(codec, WCD9XXX_HPH_L_EN, 0xC0, (val << 6));
snd_soc_update_bits(codec, WCD9XXX_HPH_R_EN, 0xC0, (val << 6));
@ -320,6 +322,8 @@ static void wcd_clsh_set_hph_mode(struct snd_soc_codec *codec,
val = 0x04;
ipeak = DELTA_I_30MA;
break;
default:
return;
};
snd_soc_update_bits(codec, WCD9XXX_A_ANA_HPH, 0x0C, val);
@ -405,6 +409,8 @@ static void wcd_clsh_state_hph_ear(struct snd_soc_codec *codec,
else if (clsh_d->state & WCD_CLSH_STATE_HPHR)
hph_mode = wcd_clsh_get_int_mode(clsh_d,
WCD_CLSH_STATE_HPHR);
else
return;
if (hph_mode != CLS_AB && !is_native_44_1_active(codec))
snd_soc_update_bits(codec,
WCD9XXX_A_CDC_RX0_RX_PATH_CFG0,
@ -606,6 +612,8 @@ static void wcd_clsh_state_hph_lo(struct snd_soc_codec *codec,
else if (clsh_d->state & WCD_CLSH_STATE_HPHR)
hph_mode = wcd_clsh_get_int_mode(clsh_d,
WCD_CLSH_STATE_HPHR);
else
return;
dev_dbg(codec->dev, "%s: hph_mode = %d\n", __func__,
hph_mode);