ASoC: qcom: common: Include link-name in error messages
Reading out the link-name earlier and including it in the various error messages makes it much more convenient to figure out what links have unmet dependencies. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20190905040306.21399-1-bjorn.andersson@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:

committed by
Mark Brown

parent
04f770d968
commit
1ab1b340f0
@@ -53,12 +53,18 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
|
|||||||
link->num_cpus = 1;
|
link->num_cpus = 1;
|
||||||
link->num_platforms = 1;
|
link->num_platforms = 1;
|
||||||
|
|
||||||
|
ret = of_property_read_string(np, "link-name", &link->name);
|
||||||
|
if (ret) {
|
||||||
|
dev_err(card->dev, "error getting codec dai_link name\n");
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
cpu = of_get_child_by_name(np, "cpu");
|
cpu = of_get_child_by_name(np, "cpu");
|
||||||
platform = of_get_child_by_name(np, "platform");
|
platform = of_get_child_by_name(np, "platform");
|
||||||
codec = of_get_child_by_name(np, "codec");
|
codec = of_get_child_by_name(np, "codec");
|
||||||
|
|
||||||
if (!cpu) {
|
if (!cpu) {
|
||||||
dev_err(dev, "Can't find cpu DT node\n");
|
dev_err(dev, "%s: Can't find cpu DT node\n", link->name);
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
@@ -66,7 +72,7 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
|
|||||||
ret = of_parse_phandle_with_args(cpu, "sound-dai",
|
ret = of_parse_phandle_with_args(cpu, "sound-dai",
|
||||||
"#sound-dai-cells", 0, &args);
|
"#sound-dai-cells", 0, &args);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(card->dev, "error getting cpu phandle\n");
|
dev_err(card->dev, "%s: error getting cpu phandle\n", link->name);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
link->cpus->of_node = args.np;
|
link->cpus->of_node = args.np;
|
||||||
@@ -74,7 +80,7 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
|
|||||||
|
|
||||||
ret = snd_soc_of_get_dai_name(cpu, &link->cpus->dai_name);
|
ret = snd_soc_of_get_dai_name(cpu, &link->cpus->dai_name);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(card->dev, "error getting cpu dai name\n");
|
dev_err(card->dev, "%s: error getting cpu dai name\n", link->name);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,14 +89,14 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
|
|||||||
"sound-dai",
|
"sound-dai",
|
||||||
0);
|
0);
|
||||||
if (!link->platforms->of_node) {
|
if (!link->platforms->of_node) {
|
||||||
dev_err(card->dev, "platform dai not found\n");
|
dev_err(card->dev, "%s: platform dai not found\n", link->name);
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = snd_soc_of_get_dai_link_codecs(dev, codec, link);
|
ret = snd_soc_of_get_dai_link_codecs(dev, codec, link);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err(card->dev, "codec dai not found\n");
|
dev_err(card->dev, "%s: codec dai not found\n", link->name);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
link->no_pcm = 1;
|
link->no_pcm = 1;
|
||||||
@@ -110,12 +116,6 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
|
|||||||
}
|
}
|
||||||
|
|
||||||
link->ignore_suspend = 1;
|
link->ignore_suspend = 1;
|
||||||
ret = of_property_read_string(np, "link-name", &link->name);
|
|
||||||
if (ret) {
|
|
||||||
dev_err(card->dev, "error getting codec dai_link name\n");
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
link->nonatomic = 1;
|
link->nonatomic = 1;
|
||||||
link->dpcm_playback = 1;
|
link->dpcm_playback = 1;
|
||||||
link->dpcm_capture = 1;
|
link->dpcm_capture = 1;
|
||||||
|
Reference in New Issue
Block a user