sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c:143 primary_codec_init() warn: missing error code? 'ret'

From: Dan Carpenter
Date: Sat Jan 07 2023 - 03:40:41 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 1f5abbd77e2c1787e74b7c2caffac97def78ba52
commit: e14657c0f0022e02c8f25fa9c56afae3d3db9e77 ASoC: mediatek: mt8186-rt5682: Modify machine driver for two DMICs case
config: microblaze-randconfig-m041-20230106
compiler: microblaze-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Reported-by: Dan Carpenter <error27@xxxxxxxxx>

smatch warnings:
sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c:143 primary_codec_init() warn: missing error code? 'ret'

vim +/ret +143 sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c

e14657c0f0022e Ajye Huang 2022-11-02 127 static int primary_codec_init(struct snd_soc_pcm_runtime *rtd)
e14657c0f0022e Ajye Huang 2022-11-02 128 {
e14657c0f0022e Ajye Huang 2022-11-02 129 struct snd_soc_card *card = rtd->card;
e14657c0f0022e Ajye Huang 2022-11-02 130 struct mtk_soc_card_data *soc_card_data = snd_soc_card_get_drvdata(card);
e14657c0f0022e Ajye Huang 2022-11-02 131 struct mt8186_mt6366_rt1019_rt5682s_priv *priv = soc_card_data->mach_priv;
e14657c0f0022e Ajye Huang 2022-11-02 132 int ret;
e14657c0f0022e Ajye Huang 2022-11-02 133
e14657c0f0022e Ajye Huang 2022-11-02 134 ret = mt8186_mt6366_init(rtd);
e14657c0f0022e Ajye Huang 2022-11-02 135
e14657c0f0022e Ajye Huang 2022-11-02 136 if (ret) {
e14657c0f0022e Ajye Huang 2022-11-02 137 dev_err(card->dev, "mt8186_mt6366_init failed: %d\n", ret);
e14657c0f0022e Ajye Huang 2022-11-02 138 return ret;
e14657c0f0022e Ajye Huang 2022-11-02 139 }
e14657c0f0022e Ajye Huang 2022-11-02 140
e14657c0f0022e Ajye Huang 2022-11-02 141 if (!priv->dmic_sel) {
e14657c0f0022e Ajye Huang 2022-11-02 142 dev_info(card->dev, "dmic_sel is null\n");
e14657c0f0022e Ajye Huang 2022-11-02 @143 return ret;

return -EIVNAL;? return 0;?

e14657c0f0022e Ajye Huang 2022-11-02 144 }
e14657c0f0022e Ajye Huang 2022-11-02 145
e14657c0f0022e Ajye Huang 2022-11-02 146 ret = snd_soc_dapm_new_controls(&card->dapm, dmic_widgets,
e14657c0f0022e Ajye Huang 2022-11-02 147 ARRAY_SIZE(dmic_widgets));
e14657c0f0022e Ajye Huang 2022-11-02 148 if (ret) {
e14657c0f0022e Ajye Huang 2022-11-02 149 dev_err(card->dev, "DMic widget addition failed: %d\n", ret);
e14657c0f0022e Ajye Huang 2022-11-02 150 /* Don't need to add routes if widget addition failed */
e14657c0f0022e Ajye Huang 2022-11-02 151 return ret;
e14657c0f0022e Ajye Huang 2022-11-02 152 }
e14657c0f0022e Ajye Huang 2022-11-02 153
e14657c0f0022e Ajye Huang 2022-11-02 154 ret = snd_soc_dapm_add_routes(&card->dapm, dmic_map,
e14657c0f0022e Ajye Huang 2022-11-02 155 ARRAY_SIZE(dmic_map));
e14657c0f0022e Ajye Huang 2022-11-02 156
e14657c0f0022e Ajye Huang 2022-11-02 157 if (ret)
e14657c0f0022e Ajye Huang 2022-11-02 158 dev_err(card->dev, "DMic map addition failed: %d\n", ret);
e14657c0f0022e Ajye Huang 2022-11-02 159
e14657c0f0022e Ajye Huang 2022-11-02 160 return ret;
e14657c0f0022e Ajye Huang 2022-11-02 161 }

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests