[PATCH v2 2/9] ASoC: amd: ps: Simplify component registration
From: phucduc . bui
Date: Fri Dec 04 2026 - 06:17:18 EST
From: bui duc phuc <phucduc.bui@xxxxxxxxx>
Return the result of devm_snd_soc_register_component() directly
in both PDM and SoundWire DMA probe functions.
This also preserves the original error code in the PDM driver
instead of converting it to -ENODEV.
Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
sound/soc/amd/ps/ps-pdm-dma.c | 13 +++----------
sound/soc/amd/ps/ps-sdw-dma.c | 12 +++---------
2 files changed, 6 insertions(+), 19 deletions(-)
diff --git a/sound/soc/amd/ps/ps-pdm-dma.c b/sound/soc/amd/ps/ps-pdm-dma.c
index 6e2e08c097a0..bb5e79c6f519 100644
--- a/sound/soc/amd/ps/ps-pdm-dma.c
+++ b/sound/soc/amd/ps/ps-pdm-dma.c
@@ -397,16 +397,9 @@ static int acp63_pdm_audio_probe(struct platform_device *pdev)
if (status)
return status;
- status = devm_snd_soc_register_component(&pdev->dev,
- &acp63_pdm_component,
- &acp63_pdm_dai_driver, 1);
- if (status) {
- dev_err(&pdev->dev, "Fail to register acp pdm dai\n");
-
- return -ENODEV;
- }
-
- return 0;
+ return devm_snd_soc_register_component(&pdev->dev,
+ &acp63_pdm_component,
+ &acp63_pdm_dai_driver, 1);
}
static int acp63_pdm_resume(struct device *dev)
diff --git a/sound/soc/amd/ps/ps-sdw-dma.c b/sound/soc/amd/ps/ps-sdw-dma.c
index 6b78b2d49b12..94f5264d5c89 100644
--- a/sound/soc/amd/ps/ps-sdw-dma.c
+++ b/sound/soc/amd/ps/ps-sdw-dma.c
@@ -681,15 +681,9 @@ static int acp63_sdw_platform_probe(struct platform_device *pdev)
if (status)
return status;
- status = devm_snd_soc_register_component(&pdev->dev,
- &acp63_sdw_component,
- NULL, 0);
- if (status) {
- dev_err(&pdev->dev, "Fail to register sdw dma component\n");
- return status;
- }
-
- return 0;
+ return devm_snd_soc_register_component(&pdev->dev,
+ &acp63_sdw_component,
+ NULL, 0);
}
static int acp63_restore_sdw_dma_config(struct sdw_dma_dev_data *sdw_data)
--
2.43.0