mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 08:26:59 +00:00
ASoC: Intel: sof_sdw: break earlier when a adr link contains different codecs
create_codec_dai_name() is used to create codec component's information in different adr links. We can and should break before we do anything. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20230731214257.444605-19-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
8673e68b59
commit
656dd91a3a
1 changed files with 9 additions and 9 deletions
|
@ -1157,6 +1157,15 @@ static int create_codec_dai_name(struct device *dev,
|
||||||
|
|
||||||
adr = adr_link->adr_d[i].adr;
|
adr = adr_link->adr_d[i].adr;
|
||||||
|
|
||||||
|
codec_index = find_codec_info_part(adr);
|
||||||
|
if (codec_index < 0)
|
||||||
|
return codec_index;
|
||||||
|
if (_codec_index != -1 && codec_index != _codec_index) {
|
||||||
|
dev_dbg(dev, "Different devices on the same sdw link\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_codec_index = codec_index;
|
||||||
|
|
||||||
sdw_version = SDW_VERSION(adr);
|
sdw_version = SDW_VERSION(adr);
|
||||||
link_id = SDW_DISCO_LINK_ID(adr);
|
link_id = SDW_DISCO_LINK_ID(adr);
|
||||||
unique_id = SDW_UNIQUE_ID(adr);
|
unique_id = SDW_UNIQUE_ID(adr);
|
||||||
|
@ -1183,15 +1192,6 @@ static int create_codec_dai_name(struct device *dev,
|
||||||
if (!codec[comp_index].name)
|
if (!codec[comp_index].name)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
codec_index = find_codec_info_part(adr);
|
|
||||||
if (codec_index < 0)
|
|
||||||
return codec_index;
|
|
||||||
if (_codec_index != -1 && codec_index != _codec_index) {
|
|
||||||
dev_dbg(dev, "Different devices on the same sdw link\n");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
_codec_index = codec_index;
|
|
||||||
|
|
||||||
codec[comp_index].dai_name =
|
codec[comp_index].dai_name =
|
||||||
codec_info_list[codec_index].dais[dai_index].dai_name;
|
codec_info_list[codec_index].dais[dai_index].dai_name;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue