ASoC: Intel: sof_sdw: remove late_probe flag in struct sof_sdw_codec_info
authorYong Zhi <yong.zhi@intel.com>
Wed, 19 Apr 2023 19:55:20 +0000 (14:55 -0500)
committerMark Brown <broonie@kernel.org>
Thu, 20 Apr 2023 11:51:50 +0000 (12:51 +0100)
Just use codec_card_late_probe ptr in struct sof_sdw_codec_info
for validation check and drop late_probe variable.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230419195524.46995-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/sof_sdw.c
sound/soc/intel/boards/sof_sdw_common.h
sound/soc/intel/boards/sof_sdw_max98373.c

index 6897705a193cb32accdd79d4a1981241d8023a95..7d398b45d48feb8070218d59ec2cca84cce18586 100644 (file)
@@ -621,7 +621,6 @@ static struct sof_sdw_codec_info codec_info_list[] = {
                .direction = {true, true},
                .dai_name = "max98373-aif1",
                .init = sof_sdw_mx8373_init,
-               .codec_card_late_probe = sof_sdw_mx8373_late_probe,
                .codec_type = SOF_SDW_CODEC_TYPE_AMP,
        },
        {
@@ -1490,12 +1489,12 @@ static int sof_sdw_card_late_probe(struct snd_soc_card *card)
        int i;
 
        for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) {
-               if (!codec_info_list[i].late_probe)
-                       continue;
+               if (codec_info_list[i].codec_card_late_probe) {
+                       ret = codec_info_list[i].codec_card_late_probe(card);
 
-               ret = codec_info_list[i].codec_card_late_probe(card);
-               if (ret < 0)
-                       return ret;
+                       if (ret < 0)
+                               return ret;
+               }
        }
 
        if (ctx->idisp_codec)
index 350010b0e5f4f1d9d999c42c1bfdd00fd8181ced..4962dc11a088e1f7431ae075fe72217fc4129352 100644 (file)
@@ -74,7 +74,6 @@ struct sof_sdw_codec_info {
                     bool playback);
 
        int (*exit)(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link);
-       bool late_probe;
        int (*codec_card_late_probe)(struct snd_soc_card *card);
 };
 
index 77a3f32db11edc98a57206fd0c41c3a264ef53b7..22bd1e356e2221fe408b1f59a45606f7e4e5afb0 100644 (file)
@@ -130,7 +130,7 @@ int sof_sdw_mx8373_init(struct snd_soc_card *card,
        if (info->amp_num == 2)
                dai_links->init = spk_init;
 
-       info->late_probe = true;
+       info->codec_card_late_probe = sof_sdw_mx8373_late_probe;
 
        dai_links->ops = &max_98373_sdw_ops;