ASoC: sdw_utils: return -EPROBE_DEFER if components are not registered yet#5788
ASoC: sdw_utils: return -EPROBE_DEFER if components are not registered yet#5788bardliao wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the SoundWire ASoC helper logic to avoid building DAI links with “default”/template component names when the real ASoC components (e.g., SDCA function components) have not registered yet, by deferring probe until the components appear.
Changes:
- Change
asoc_sdw_get_codec_name()to return-EPROBE_DEFER(viaERR_PTR) when a specifieddai_info->codec_namecomponent is not registered yet. - Change
asoc_sdw_parse_sdw_endpoints()to return-EPROBE_DEFERwhen required aux components are not registered yet. - Add
IS_ERR()/PTR_ERR()handling forasoc_sdw_get_codec_name()results inasoc_sdw_parse_sdw_endpoints().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| dev_dbg(dev, "%s component %s is not registered yet\n", | ||
| __func__, dai_info->codec_name); | ||
| return ERR_PTR(-EPROBE_DEFER); |
…d yet We set the get the right component name from the registered components and use it in the dai links. It will lead to bind fail if the default component name is used. Return -EPROBE_DEFER to allow the machine driver probe again after the components are registered. Suggested-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
kv2019i
left a comment
There was a problem hiding this comment.
Code looks good, minor issue in git commit message.
| return devm_kstrdup(dev, component->name, GFP_KERNEL); | ||
| } else { | ||
| return devm_kstrdup(dev, dai_info->codec_name, GFP_KERNEL); | ||
| dev_dbg(dev, "%s component %s is not registered yet\n", |
There was a problem hiding this comment.
Code looks good but the first sentence in commit message is wrong:
-We set the get the right component name from the registered components and use it in the dai links.
+We get the right component name from the registered components and use it in the dai links.
..? I guess that's the intention?
We set the get the right component name from the registered components and use it in the dai links. It will lead to bind fail if the default component name is used. Return -EPROBE_DEFER to allow the machine driver probe again after the components are registered.