Commit 05892464 authored by Curtis Malainey's avatar Curtis Malainey Committed by Mark Brown

ASoC: Intel: sof_cirrus_common: Guard against missing buses

Even if we find a acpi device we can still be missing the physical node.
Signed-off-by: default avatarCurtis Malainey <cujomalainey@chromium.org>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230419195524.46995-2-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 09cda705
......@@ -168,11 +168,16 @@ static int cs35l41_compute_codec_conf(void)
continue;
}
physdev = get_device(acpi_get_first_physical_node(adev));
acpi_dev_put(adev);
if (!physdev) {
pr_devel("Cannot find physical node for HID %s UID %u (%s)\n", CS35L41_HID,
uid, cs35l41_name_prefixes[uid]);
return 0;
}
cs35l41_components[sz].name = dev_name(physdev);
cs35l41_components[sz].dai_name = CS35L41_CODEC_DAI;
cs35l41_codec_conf[sz].dlc.name = dev_name(physdev);
cs35l41_codec_conf[sz].name_prefix = cs35l41_name_prefixes[uid];
acpi_dev_put(adev);
sz++;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment