audio: coveriy fix [1/1]

PD#SWPL-14015

Problem:
Coverity defect cleanup.

Solution:
Coverity defect cleanup.

Verify:
SM1

Change-Id: I5d564ddafb4105b80c0243efafa6fe141fd59be7
Signed-off-by: Shuai Li <shuai.li@amlogic.com>
This commit is contained in:
Shuai Li
2019-10-19 17:49:10 +08:00
committed by Jianxin Pan
parent 7a39b8f222
commit 06ce23cdda
4 changed files with 14 additions and 12 deletions

View File

@@ -1786,11 +1786,11 @@ static int aml_tdm_platform_suspend(struct platform_device *pdev,
/*mute default clk */
if (p_tdm->start_clk_enable == 1 && p_tdm->pin_ctl) {
struct pinctrl_state *state = NULL;
struct pinctrl_state *ps = NULL;
state = pinctrl_lookup_state(p_tdm->pin_ctl, "tdmout_a_gpio");
if (!IS_ERR_OR_NULL(state)) {
pinctrl_select_state(p_tdm->pin_ctl, state);
ps = pinctrl_lookup_state(p_tdm->pin_ctl, "tdmout_a_gpio");
if (!IS_ERR_OR_NULL(ps)) {
pinctrl_select_state(p_tdm->pin_ctl, ps);
pr_info("%s tdm pins disable!\n", __func__);
}
}

View File

@@ -242,7 +242,9 @@ static int aml_pcm_timer_create(struct snd_pcm_substream *substream)
prtd->timer_period = 1;
prtd->timer.data = (unsigned long)substream;
prtd->timer.function = aml_pcm_timer_callback;
spin_lock(&prtd->lock);
prtd->running = 0;
spin_unlock(&prtd->lock);
return 0;
}

View File

@@ -145,12 +145,17 @@ static int aml_pcm_dai_trigger(struct snd_pcm_substream *substream, int cmd,
{
struct aml_pcm *pcm_p = dev_get_drvdata(dai->dev);
if (!pcm_p) {
pr_err("%s(), null ptr\n", __func__);
return -EINVAL;
}
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
/* TODO */
if (pcm_p && pcm_p->pcm_mode) {
if (pcm_p->pcm_mode) {
pr_info("aiu pcm master stream %d enable\n\n",
substream->stream);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
@@ -169,7 +174,7 @@ static int aml_pcm_dai_trigger(struct snd_pcm_substream *substream, int cmd,
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_SUSPEND:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
if (pcm_p && pcm_p->pcm_mode) {
if (pcm_p->pcm_mode) {
pr_info("aiu master pcm stream %d disable\n\n",
substream->stream);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)

View File

@@ -1087,17 +1087,12 @@ static int tas5805m_probe(struct snd_soc_codec *codec)
int ret;
struct tas5805m_priv *tas5805m = snd_soc_codec_get_drvdata(codec);
// ret =
// regmap_register_patch(tas5805m->regmap, tas5805m_init_sequence,
// ARRAY_SIZE(tas5805m_init_sequence));
usleep_range(20 * 1000, 21 * 1000);
ret = tas5805m_reg_init(codec);
if (ret != 0)
goto err;
if (tas5805m)
tas5805m_set_volume(codec, tas5805m->vol);
tas5805m_set_volume(codec, tas5805m->vol);
snd_soc_add_codec_controls(codec, tas5805m_vol_control,
ARRAY_SIZE(tas5805m_vol_control));
tas5805m->codec = codec;