diff mbox series

ASoC: img: Add error handling for clk_set_rate in img_prl_out_hw_params

Message ID 20230923062054.19325-1-liuhaoran14@163.com
State New
Headers show
Series ASoC: img: Add error handling for clk_set_rate in img_prl_out_hw_params | expand

Commit Message

Haoran Liu Sept. 23, 2023, 6:20 a.m. UTC
This patch adds error-handling for the clk_set_rate() call inside
the img_prl_out_hw_params function in the img-parallel-out.c file.

Signed-off-by: liuhaoran <liuhaoran14@163.com>
---
 sound/soc/img/img-parallel-out.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/sound/soc/img/img-parallel-out.c b/sound/soc/img/img-parallel-out.c
index 815e68a7048c..698e9e92ded9 100644
--- a/sound/soc/img/img-parallel-out.c
+++ b/sound/soc/img/img-parallel-out.c
@@ -137,7 +137,10 @@  static int img_prl_out_hw_params(struct snd_pcm_substream *substream,
 	if (channels != 2)
 		return -EINVAL;
 
-	clk_set_rate(prl->clk_ref, rate * 256);
+	int ret = clk_set_rate(prl->clk_ref, rate * 256);
+
+	if (!ret)
+		return ret;
 
 	reg = img_prl_out_readl(prl, IMG_PRL_OUT_CTL);
 	reg = (reg & ~IMG_PRL_OUT_CTL_PACKH_MASK) | control_set;