[PATCH 3/3] pmdomain: rockchip: report domain errors where they happen

From: Arun Iyengar via B4 Relay

Date: Thu Nov 26 2026 - 05:01:45 EST


From: Arun Iyengar <aiyengar1990@xxxxxxxxx>

Print the clock prepare and pm_qos failures with dev_err_probe() and
drop the callers' "failed to handle node" messages. Each error is now
reported once, and -ENOMEM stays quiet.

Suggested-by: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>
Signed-off-by: Arun Iyengar <aiyengar1990@xxxxxxxxx>
---
drivers/pmdomain/rockchip/pm-domains.c | 40 +++++++++++++++-------------------
1 file changed, 17 insertions(+), 23 deletions(-)

diff --git a/drivers/pmdomain/rockchip/pm-domains.c b/drivers/pmdomain/rockchip/pm-domains.c
index 9d5a79c6d4f9..c3df32934120 100644
--- a/drivers/pmdomain/rockchip/pm-domains.c
+++ b/drivers/pmdomain/rockchip/pm-domains.c
@@ -881,17 +881,19 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu,
for (i = 0; i < pd->num_clks; i++) {
pd->clks[i].clk = of_clk_get(node, i);
if (IS_ERR(pd->clks[i].clk)) {
- error = PTR_ERR(pd->clks[i].clk);
- dev_err_probe(pmu->dev, error,
- "%pOFn: failed to get clk at index %d: %d\n",
- node, i, error);
+ error = dev_err_probe(pmu->dev, PTR_ERR(pd->clks[i].clk),
+ "%pOFn: failed to get clk at index %d\n",
+ node, i);
goto err_put_clocks;
}
}

error = clk_bulk_prepare(pd->num_clks, pd->clks);
- if (error)
+ if (error) {
+ dev_err_probe(pmu->dev, error,
+ "%pOFn: failed to prepare clocks\n", node);
goto err_put_clocks;
+ }

pd->num_qos = of_count_phandle_with_args(node, "pm_qos",
NULL);
@@ -916,13 +918,18 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu,
for (j = 0; j < pd->num_qos; j++) {
qos_node = of_parse_phandle(node, "pm_qos", j);
if (!qos_node) {
- error = -ENODEV;
+ error = dev_err_probe(pmu->dev, -ENODEV,
+ "%pOFn: failed to get pm_qos %d\n",
+ node, j);
goto err_unprepare_clocks;
}
pd->qos_regmap[j] = syscon_node_to_regmap(qos_node);
of_node_put(qos_node);
if (IS_ERR(pd->qos_regmap[j])) {
- error = PTR_ERR(pd->qos_regmap[j]);
+ error = dev_err_probe(pmu->dev,
+ PTR_ERR(pd->qos_regmap[j]),
+ "%pOFn: failed to get pm_qos %d regmap\n",
+ node, j);
goto err_unprepare_clocks;
}
}
@@ -1074,13 +1081,8 @@ static int rockchip_pm_add_subdomain(struct rockchip_pmu *pmu,

error = rockchip_pm_add_one_domain(pmu, np,
to_rockchip_pd(parent_domain));
- if (error) {
- if (error != -EPROBE_DEFER)
- dev_err(pmu->dev,
- "failed to handle node %pOFn: %d\n",
- np, error);
+ if (error)
return error;
- }

error = of_property_read_u32(np, "reg", &idx);
if (error)
@@ -1162,20 +1164,12 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev)

for_each_available_child_of_node_scoped(np, node) {
error = rockchip_pm_add_one_domain(pmu, node, NULL);
- if (error) {
- if (error != -EPROBE_DEFER)
- dev_err(dev, "failed to handle node %pOFn: %d\n",
- node, error);
+ if (error)
goto err_out;
- }

error = rockchip_pm_add_subdomain(pmu, node);
- if (error < 0) {
- if (error != -EPROBE_DEFER)
- dev_err(dev, "failed to handle subdomain node %pOFn: %d\n",
- node, error);
+ if (error < 0)
goto err_out;
- }

/* A domain left on is not fatal; carry on with the others. */
rockchip_pm_power_off_subtree(pmu, node);

--
2.55.0