Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: stm: stm32_sai: Use dev_err_probe()

Replace the open-code with dev_err_probe() to simplify the code.

Signed-off-by: Zhang Enpei <zhang.enpei@zte.com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
Link: https://patch.msgid.link/20250403154142936Po-soX8Bifyvw_eWSbddT@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Zhang Enpei and committed by
Mark Brown
d01131e3 0af2f6be

+6 -12
+6 -12
sound/soc/stm/stm32_sai.c
··· 169 169 struct device *dev = &sai->pdev->dev; 170 170 171 171 sai->clk_x8k = devm_clk_get(dev, "x8k"); 172 - if (IS_ERR(sai->clk_x8k)) { 173 - if (PTR_ERR(sai->clk_x8k) != -EPROBE_DEFER) 174 - dev_err(dev, "missing x8k parent clock: %ld\n", 175 - PTR_ERR(sai->clk_x8k)); 176 - return PTR_ERR(sai->clk_x8k); 177 - } 172 + if (IS_ERR(sai->clk_x8k)) 173 + return dev_err_probe(dev, PTR_ERR(sai->clk_x8k), 174 + "missing x8k parent clock\n"); 178 175 179 176 sai->clk_x11k = devm_clk_get(dev, "x11k"); 180 - if (IS_ERR(sai->clk_x11k)) { 181 - if (PTR_ERR(sai->clk_x11k) != -EPROBE_DEFER) 182 - dev_err(dev, "missing x11k parent clock: %ld\n", 183 - PTR_ERR(sai->clk_x11k)); 184 - return PTR_ERR(sai->clk_x11k); 185 - } 177 + if (IS_ERR(sai->clk_x11k)) 178 + return dev_err_probe(dev, PTR_ERR(sai->clk_x11k), 179 + "missing x11k parent clock\n"); 186 180 187 181 return 0; 188 182 }