ASoC: rt5682: Return devm_of_clk_add_hw_provider to transfer the error

commit fcca6d05ef49d5650514ea1dcfd12e4ae3ff2be6 upstream.

Return devm_of_clk_add_hw_provider() in order to transfer the error, if it
fails due to resource allocation failure or device tree clock provider
registration failure.

Cc: stable@vger.kernel.org
Fixes: ebbfabc16d ("ASoC: rt5682: Add CCF usage for providing I2S clks")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Link: https://patch.msgid.link/20240830143154.3448004-1-make24@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Ma Ke 2024-08-30 22:31:54 +08:00 committed by Greg Kroah-Hartman
parent 513d60f419
commit 543a3c7dbd
1 changed files with 3 additions and 1 deletions

View File

@ -2903,8 +2903,10 @@ int rt5682_register_dai_clks(struct rt5682_priv *rt5682)
} }
if (dev->of_node) { if (dev->of_node) {
devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get,
dai_clk_hw); dai_clk_hw);
if (ret)
return ret;
} else { } else {
ret = devm_clk_hw_register_clkdev(dev, dai_clk_hw, ret = devm_clk_hw_register_clkdev(dev, dai_clk_hw,
init.name, init.name,