[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250403154142936Po-soX8Bifyvw_eWSbddT@zte.com.cn>
Date: Thu, 3 Apr 2025 15:41:42 +0800 (CST)
From: <shao.mingyin@....com.cn>
To: <olivier.moysan@...s.st.com>
Cc: <arnaud.pouliquen@...s.st.com>, <lgirdwood@...il.com>,
<broonie@...nel.org>, <perex@...ex.cz>, <tiwai@...e.com>,
<mcoquelin.stm32@...il.com>, <alexandre.torgue@...s.st.com>,
<linux-sound@...r.kernel.org>,
<linux-stm32@...md-mailman.stormreply.com>,
<linux-arm-kernel@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
<yang.yang29@....com.cn>, <xu.xin16@....com.cn>,
<ye.xingchen@....com.cn>, <zhang.enpei@....com.cn>
Subject: [PATCH] sound: soc: stm: stm32_sai: Use dev_err_probe()
From: Zhang Enpei <zhang.enpei@....com.cn>
Replace the open-code with dev_err_probe() to simplify the code.
Signed-off-by: Zhang Enpei <zhang.enpei@....com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@....com.cn>
---
sound/soc/stm/stm32_sai.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/sound/soc/stm/stm32_sai.c b/sound/soc/stm/stm32_sai.c
index 504a14584765..fa821e3fb427 100644
--- a/sound/soc/stm/stm32_sai.c
+++ b/sound/soc/stm/stm32_sai.c
@@ -169,20 +169,14 @@ static int stm32_sai_get_parent_clk(struct stm32_sai_data *sai)
struct device *dev = &sai->pdev->dev;
sai->clk_x8k = devm_clk_get(dev, "x8k");
- if (IS_ERR(sai->clk_x8k)) {
- if (PTR_ERR(sai->clk_x8k) != -EPROBE_DEFER)
- dev_err(dev, "missing x8k parent clock: %ld\n",
- PTR_ERR(sai->clk_x8k));
- return PTR_ERR(sai->clk_x8k);
- }
+ if (IS_ERR(sai->clk_x8k))
+ return dev_err_probe(dev, PTR_ERR(sai->clk_x8k),
+ "missing x8k parent clock\n");
sai->clk_x11k = devm_clk_get(dev, "x11k");
- if (IS_ERR(sai->clk_x11k)) {
- if (PTR_ERR(sai->clk_x11k) != -EPROBE_DEFER)
- dev_err(dev, "missing x11k parent clock: %ld\n",
- PTR_ERR(sai->clk_x11k));
- return PTR_ERR(sai->clk_x11k);
- }
+ if (IS_ERR(sai->clk_x11k))
+ return dev_err_probe(dev, PTR_ERR(sai->clk_x11k),
+ "missing x11k parent clock\n");
return 0;
}
--
2.25.1
Powered by blists - more mailing lists