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

From: Ajay Kumar Nandam

Date: Wed Jul 15 2026 - 04:30:16 EST


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

Signed-off-by: Ajay Kumar Nandam <ajay.nandam@xxxxxxxxxxxxxxxx>
---
sound/soc/codecs/lpass-va-macro.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/lpass-va-macro.c b/sound/soc/codecs/lpass-va-macro.c
index 946051698420..dbc5795b9273 100644
--- a/sound/soc/codecs/lpass-va-macro.c
+++ b/sound/soc/codecs/lpass-va-macro.c
@@ -1605,7 +1605,9 @@ static int va_macro_probe(struct platform_device *pdev)
va->has_npl_clk = data->has_npl_clk;

/* mclk rate */
- clk_set_rate(va->mclk, 2 * VA_MACRO_MCLK_FREQ);
+ ret = clk_set_rate(va->mclk, 2 * VA_MACRO_MCLK_FREQ);
+ if (ret)
+ goto err;

if (va->has_npl_clk) {
va->npl = devm_clk_get(dev, "npl");
@@ -1614,7 +1616,9 @@ static int va_macro_probe(struct platform_device *pdev)
goto err;
}

- clk_set_rate(va->npl, 2 * VA_MACRO_MCLK_FREQ);
+ ret = clk_set_rate(va->npl, 2 * VA_MACRO_MCLK_FREQ);
+ if (ret)
+ goto err;
}

ret = devm_pm_clk_create(dev);

--
2.34.1