Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion sound/soc/sof/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,31 @@ static struct snd_sof_of_mach *sof_of_machine_select(struct snd_sof_dev *sdev)
struct snd_sof_pdata *sof_pdata = sdev->pdata;
const struct sof_dev_desc *desc = sof_pdata->desc;
struct snd_sof_of_mach *mach = desc->of_machines;
const char *tplg_name;
int ret;

if (!mach)
return NULL;

for (; mach->compatible; mach++) {
if (of_machine_is_compatible(mach->compatible)) {
sof_pdata->tplg_filename = mach->sof_tplg_filename;

if (mach->fw_filename)
sof_pdata->fw_filename = mach->fw_filename;

ret = of_property_read_string(sdev->dev->of_node,
"tplg-name",
&tplg_name);
if (ret < 0 && ret != -EINVAL) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add && ret != -ENOSYS in case CONFIG_OF is not set?
https://github.com/thesofproject/linux/blob/topic/sof-dev/include/linux/of.h#L724

static inline int of_property_read_string(const struct device_node *np,
					  const char *propname,
					  const char **out_string)
{
	return -ENOSYS;
}

dev_err(sdev->dev, "failed to fetch topology name: %d\n", ret);
return NULL;
}

if (ret == -EINVAL)
sof_pdata->tplg_filename = mach->sof_tplg_filename;
else
sof_pdata->tplg_filename = tplg_name;

return mach;
}
}
Expand Down
Loading