mirror of
https://github.com/torvalds/linux.git
synced 2026-10-11 04:47:02 +02:00
ASoC: codecs: lpass-{wsa,va}-macro: check clk_set_rate() return value
Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com> says: clk_set_rate() returns 0 on success or a negative errno on failure but the WSA and VA macro probe functions are ignoring it. This series adds return value checking and bails out of probe on failure. This mirrors the same fix already posted for the TX and RX macros [1]. [1] https://lore.kernel.org/all/20260707-xo-sd-codec-tx-rx-v2-3-f61b4622f97f@oss.qualcomm.com/ Link: https://patch.msgid.link/20260715-xo-sd-codec-wsa-va-clk-set-rate-v2-0-16ca64c2b929@oss.qualcomm.com
This commit is contained in:
commit
7619cfb830
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user