[PATCH v2 1/2] ASoC: codecs: lpass-wsa-macro: check clk_set_rate() return value

From: Ajay Kumar Nandam

Date: Wed Jul 15 2026 - 08:01:40 EST


clk_set_rate() returns 0 on success or a negative errno on failure but
the WSA macro probe function is ignoring it. Check the return value and
bail out of probe on failure.

Reviewed-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>
Signed-off-by: Ajay Kumar Nandam <ajay.nandam@xxxxxxxxxxxxxxxx>
---
sound/soc/codecs/lpass-wsa-macro.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
index f511816aa4a0..fc9e0a37c042 100644
--- a/sound/soc/codecs/lpass-wsa-macro.c
+++ b/sound/soc/codecs/lpass-wsa-macro.c
@@ -2773,8 +2773,13 @@ static int wsa_macro_probe(struct platform_device *pdev)
wsa->dev = dev;

/* set MCLK and NPL rates */
- clk_set_rate(wsa->mclk, WSA_MACRO_MCLK_FREQ);
- clk_set_rate(wsa->npl, WSA_MACRO_MCLK_FREQ);
+ ret = clk_set_rate(wsa->mclk, WSA_MACRO_MCLK_FREQ);
+ if (ret)
+ return ret;
+
+ ret = clk_set_rate(wsa->npl, WSA_MACRO_MCLK_FREQ);
+ if (ret)
+ return ret;

ret = devm_pm_clk_create(dev);
if (ret)

--
2.34.1