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

From: Ajay Kumar Nandam

Date: Wed Jul 15 2026 - 08:21:21 EST




On 7/15/2026 3:03 PM, Cezary Rojewski wrote:
On 7/15/2026 10:29 AM, Ajay Kumar Nandam wrote:
clk_set_rate() returns 0 on success or a negative errno on failure but
the WSA macro probe function was ignoring it. Check the return value and

_is_ ignoring it. s/was/is/.

A patch is a proposal, there is no "was" until it is merged.

bail out of probe on failure.

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)


Apart from a nitpick in the commit message, code looks good.

ACK, updated in V2 version