Skip to content

ASoC: sdw_utils: return -EPROBE_DEFER if components are not registered yet#5788

Open
bardliao wants to merge 1 commit into
thesofproject:topic/sof-devfrom
bardliao:for-defer-probe
Open

ASoC: sdw_utils: return -EPROBE_DEFER if components are not registered yet#5788
bardliao wants to merge 1 commit into
thesofproject:topic/sof-devfrom
bardliao:for-defer-probe

Conversation

@bardliao
Copy link
Copy Markdown
Collaborator

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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 (via ERR_PTR) when a specified dai_info->codec_name component is not registered yet.
  • Change asoc_sdw_parse_sdw_endpoints() to return -EPROBE_DEFER when required aux components are not registered yet.
  • Add IS_ERR()/PTR_ERR() handling for asoc_sdw_get_codec_name() results in asoc_sdw_parse_sdw_endpoints().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1632 to +1634
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants