* [PATCH 1/1] clk: bulk: Use dev_err_probe() helper in of_clk_bulk_get()
@ 2026-04-22 12:53 Alexander Stein
2026-04-23 13:01 ` Brian Masney
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Stein @ 2026-04-22 12:53 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd; +Cc: Alexander Stein, linux-clk, linux-kernel
pr_err() can be replace with dev_err_probe() which will check if error
code is -EPROBE_DEFER. For that the dev pointer has to be passed along.
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
This silences several error messages while probing PCIe on my i.MX95
based platform:
/soc/pcie@4c380000: Failed to get clk index: 4 ret: -517
/soc/pcie@4c300000: Failed to get clk index: 4 ret: -517
/soc/pcie@4c380000: Failed to get clk index: 4 ret: -517
drivers/clk/clk-bulk.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/clk/clk-bulk.c b/drivers/clk/clk-bulk.c
index d85dae4bdf895..acd9dff300722 100644
--- a/drivers/clk/clk-bulk.c
+++ b/drivers/clk/clk-bulk.c
@@ -12,7 +12,8 @@
#include <linux/of.h>
#include <linux/slab.h>
-static int __must_check of_clk_bulk_get(struct device_node *np, int num_clks,
+static int __must_check of_clk_bulk_get(struct device *dev,
+ struct device_node *np, int num_clks,
struct clk_bulk_data *clks)
{
int ret;
@@ -28,8 +29,8 @@ static int __must_check of_clk_bulk_get(struct device_node *np, int num_clks,
clks[i].clk = of_clk_get(np, i);
if (IS_ERR(clks[i].clk)) {
ret = PTR_ERR(clks[i].clk);
- pr_err("%pOF: Failed to get clk index: %d ret: %d\n",
- np, i, ret);
+ dev_err_probe(dev, ret, "%pOF: Failed to get clk index: %d (%s)\n",
+ np, i, clks[i].id);
clks[i].clk = NULL;
goto err;
}
@@ -43,7 +44,8 @@ static int __must_check of_clk_bulk_get(struct device_node *np, int num_clks,
return ret;
}
-static int __must_check of_clk_bulk_get_all(struct device_node *np,
+static int __must_check of_clk_bulk_get_all(struct device *dev,
+ struct device_node *np,
struct clk_bulk_data **clks)
{
struct clk_bulk_data *clk_bulk;
@@ -58,7 +60,7 @@ static int __must_check of_clk_bulk_get_all(struct device_node *np,
if (!clk_bulk)
return -ENOMEM;
- ret = of_clk_bulk_get(np, num_clks, clk_bulk);
+ ret = of_clk_bulk_get(dev, np, num_clks, clk_bulk);
if (ret) {
kfree(clk_bulk);
return ret;
@@ -144,7 +146,7 @@ int __must_check clk_bulk_get_all(struct device *dev,
if (!np)
return 0;
- return of_clk_bulk_get_all(np, clks);
+ return of_clk_bulk_get_all(dev, np, clks);
}
EXPORT_SYMBOL(clk_bulk_get_all);
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-23 13:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-22 12:53 [PATCH 1/1] clk: bulk: Use dev_err_probe() helper in of_clk_bulk_get() Alexander Stein
2026-04-23 13:01 ` Brian Masney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox