未验证 提交 9e9fb5d3 编写于 作者: P Pierre-Louis Bossart 提交者: Mark Brown

ASoC: mediatek: mt8195: simplify error handling

cppcheck warnings:

sound/soc/mediatek/mt8195/mt8195-afe-clk.c:311:9: warning: Identical
condition and return expression 'ret', return value is always 0
[identicalConditionAfterEarlyExit]
 return ret;
        ^
sound/soc/mediatek/mt8195/mt8195-afe-clk.c:297:6: note: If condition
'ret' is true, the function will return/exit
 if (ret)
     ^
sound/soc/mediatek/mt8195/mt8195-afe-clk.c:311:9: note: Returning
identical expression 'ret'
 return ret;
        ^
sound/soc/mediatek/mt8195/mt8195-afe-clk.c:341:9: warning: Identical
condition and return expression 'ret', return value is always 0
[identicalConditionAfterEarlyExit]
 return ret;
        ^
sound/soc/mediatek/mt8195/mt8195-afe-clk.c:338:6: note: If condition
'ret' is true, the function will return/exit
if (ret)
     ^
sound/soc/mediatek/mt8195/mt8195-afe-clk.c:341:9: note: Returning
identical expression 'ret'
return ret;
        ^
Signed-off-by: NPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: NBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: NPéter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220520211719.607543-12-pierre-louis.bossart@linux.intel.comSigned-off-by: NMark Brown <broonie@kernel.org>
上级 f057852f
...@@ -284,7 +284,7 @@ static int mt8195_afe_enable_apll_tuner(struct mtk_base_afe *afe, ...@@ -284,7 +284,7 @@ static int mt8195_afe_enable_apll_tuner(struct mtk_base_afe *afe,
{ {
struct mt8195_afe_tuner_cfg *cfg = mt8195_afe_found_apll_tuner(id); struct mt8195_afe_tuner_cfg *cfg = mt8195_afe_found_apll_tuner(id);
unsigned long flags; unsigned long flags;
int ret = 0; int ret;
if (!cfg) if (!cfg)
return -EINVAL; return -EINVAL;
...@@ -308,7 +308,7 @@ static int mt8195_afe_enable_apll_tuner(struct mtk_base_afe *afe, ...@@ -308,7 +308,7 @@ static int mt8195_afe_enable_apll_tuner(struct mtk_base_afe *afe,
spin_unlock_irqrestore(&cfg->ctrl_lock, flags); spin_unlock_irqrestore(&cfg->ctrl_lock, flags);
return ret; return 0;
} }
static int mt8195_afe_disable_apll_tuner(struct mtk_base_afe *afe, static int mt8195_afe_disable_apll_tuner(struct mtk_base_afe *afe,
...@@ -316,7 +316,7 @@ static int mt8195_afe_disable_apll_tuner(struct mtk_base_afe *afe, ...@@ -316,7 +316,7 @@ static int mt8195_afe_disable_apll_tuner(struct mtk_base_afe *afe,
{ {
struct mt8195_afe_tuner_cfg *cfg = mt8195_afe_found_apll_tuner(id); struct mt8195_afe_tuner_cfg *cfg = mt8195_afe_found_apll_tuner(id);
unsigned long flags; unsigned long flags;
int ret = 0; int ret;
if (!cfg) if (!cfg)
return -EINVAL; return -EINVAL;
...@@ -338,7 +338,7 @@ static int mt8195_afe_disable_apll_tuner(struct mtk_base_afe *afe, ...@@ -338,7 +338,7 @@ static int mt8195_afe_disable_apll_tuner(struct mtk_base_afe *afe,
if (ret) if (ret)
return ret; return ret;
return ret; return 0;
} }
int mt8195_afe_get_mclk_source_clk_id(int sel) int mt8195_afe_get_mclk_source_clk_id(int sel)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册