[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241114162926.3356551-2-jan.dakinevich@salutedevices.com>
Date: Thu, 14 Nov 2024 19:29:24 +0300
From: Jan Dakinevich <jan.dakinevich@...utedevices.com>
To: Jan Dakinevich <jan.dakinevich@...utedevices.com>, Jerome Brunet
<jbrunet@...libre.com>, Kevin Hilman <khilman@...libre.com>,
<linux-amlogic@...ts.infradead.org>, <linux-arm-kernel@...ts.infradead.org>,
<linux-clk@...r.kernel.org>, <linux-kernel@...r.kernel.org>, "Martin
Blumenstingl" <martin.blumenstingl@...glemail.com>, Michael Turquette
<mturquette@...libre.com>, Neil Armstrong <neil.armstrong@...aro.org>,
Stephen Boyd <sboyd@...nel.org>
Subject: [RFC PATCH 1/3] clk: amlogic: axg-audio: use dev_err_probe()
Replace dev_err() with dev_err_probe() to simplify the code.
Signed-off-by: Jan Dakinevich <jan.dakinevich@...utedevices.com>
---
drivers/clk/meson/axg-audio.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/drivers/clk/meson/axg-audio.c b/drivers/clk/meson/axg-audio.c
index 7714bde5ffc0..05a72a199ebd 100644
--- a/drivers/clk/meson/axg-audio.c
+++ b/drivers/clk/meson/axg-audio.c
@@ -1714,10 +1714,8 @@ static int axg_audio_clkc_probe(struct platform_device *pdev)
axg_audio_regmap_cfg.max_register = data->max_register;
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\n");
/* Get the mandatory peripheral clock */
clk = devm_clk_get_enabled(dev, "pclk");
@@ -1725,10 +1723,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++)
@@ -1746,10 +1742,9 @@ static int axg_audio_clkc_probe(struct platform_device *pdev)
name = hw->init->name;
ret = devm_clk_hw_register(dev, hw);
- if (ret) {
- dev_err(dev, "failed to register clock %s\n", name);
- return ret;
- }
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to register clock %s\n",
+ name);
}
ret = devm_of_clk_add_hw_provider(dev, meson_clk_hw_get, (void *)&data->hw_clks);
--
2.34.1
Powered by blists - more mailing lists