Skip to content

Commit 1f46a66

Browse files
committed
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: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
1 parent 2b7da56 commit 1f46a66

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

sound/soc/mediatek/mt8195/mt8195-afe-clk.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ static int mt8195_afe_enable_apll_tuner(struct mtk_base_afe *afe,
284284
{
285285
struct mt8195_afe_tuner_cfg *cfg = mt8195_afe_found_apll_tuner(id);
286286
unsigned long flags;
287-
int ret = 0;
287+
int ret;
288288

289289
if (!cfg)
290290
return -EINVAL;
@@ -308,15 +308,15 @@ static int mt8195_afe_enable_apll_tuner(struct mtk_base_afe *afe,
308308

309309
spin_unlock_irqrestore(&cfg->ctrl_lock, flags);
310310

311-
return ret;
311+
return 0;
312312
}
313313

314314
static int mt8195_afe_disable_apll_tuner(struct mtk_base_afe *afe,
315315
unsigned int id)
316316
{
317317
struct mt8195_afe_tuner_cfg *cfg = mt8195_afe_found_apll_tuner(id);
318318
unsigned long flags;
319-
int ret = 0;
319+
int ret;
320320

321321
if (!cfg)
322322
return -EINVAL;
@@ -338,7 +338,7 @@ static int mt8195_afe_disable_apll_tuner(struct mtk_base_afe *afe,
338338
if (ret)
339339
return ret;
340340

341-
return ret;
341+
return 0;
342342
}
343343

344344
int mt8195_afe_get_mclk_source_clk_id(int sel)

0 commit comments

Comments
 (0)