[PATCH v1] clk: meson: axg-audio: Use dev_err_probe() to simplfy code
Chen Yufan
chenyufan at vivo.com
Fri Aug 30 01:01:03 PDT 2024
Use dev_err_probe() can make code a bit simpler.
Signed-off-by: Chen Yufan <chenyufan at vivo.com>
---
drivers/clk/meson/axg-audio.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/clk/meson/axg-audio.c b/drivers/clk/meson/axg-audio.c
index e03a5bf899c0..0637b05a4c89 100644
--- a/drivers/clk/meson/axg-audio.c
+++ b/drivers/clk/meson/axg-audio.c
@@ -1761,10 +1761,8 @@ static int axg_audio_clkc_probe(struct platform_device *pdev)
return PTR_ERR(regs);
map = devm_regmap_init_mmio(dev, regs, &axg_audio_regmap_cfg);
- if (IS_ERR(map)) {
- dev_err(dev, "failed to init regmap: %ld\n", PTR_ERR(map));
- return PTR_ERR(map);
- }
+ if (IS_ERR(map))
+ return dev_err_probe(dev, PTR_ERR(map), "failed to init regmap: %ld\n");
/* Get the mandatory peripheral clock */
clk = devm_clk_get_enabled(dev, "pclk");
@@ -1772,10 +1770,8 @@ static int axg_audio_clkc_probe(struct platform_device *pdev)
return PTR_ERR(clk);
ret = device_reset(dev);
- if (ret) {
- dev_err_probe(dev, ret, "failed to reset device\n");
- return ret;
- }
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to reset device\n");
/* Populate regmap for the regmap backed clocks */
for (i = 0; i < data->regmap_clk_num; i++)
--
2.39.0
More information about the linux-amlogic
mailing list