Skip to contentSkip to conversation

OPP: Use dev_err_probe() when failing to get icc_path

PATCH Applied Andrew Halaney 2 participants 2 messages Jun 23, 2023 – Jun 26, 2023 Operating performance points (OPP)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OPP: Use dev_err_probe() when failing to get icc_path

This, in tandem with dynamic debug, can print useful information about -EPROBE_DEFFER like below, and keeps similar behavior for other errors:

    [   16.561072] cpu cpu0: error -EPROBE_DEFER: dev_pm_opp_of_find_icc_paths: Unable to get path0
    [   16.575777] platform 18591000.cpufreq: deferred probe pending
---
 drivers/opp/of.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/opp/of.c +1 -5
index e6d1155d0990..1f0923cc1cd9 100644
@@ -513,11 +513,7 @@ int dev_pm_opp_of_find_icc_paths(struct device *dev,
 	for (i = 0; i < num_paths; i++) {
 		paths[i] = of_icc_get_by_index(dev, i);
 		if (IS_ERR(paths[i])) {
-			ret = PTR_ERR(paths[i]);
-			if (ret != -EPROBE_DEFER) {
-				dev_err(dev, "%s: Unable to get path%d: %d\n",
-					__func__, i, ret);
-			}
+			ret = dev_err_probe(dev, ret, "%s: Unable to get path%d\n", __func__, i);
 			goto err;
 		}
 	}
Signature · 1 line
2.40.1
Applied
#1 lore raw
Quoted 18 lines · Andrew Halaney

This, in tandem with dynamic debug, can print useful information about -EPROBE_DEFFER like below, and keeps similar behavior for other errors:

    [   16.561072] cpu cpu0: error -EPROBE_DEFER: dev_pm_opp_of_find_icc_paths: Unable to get path0
    [   16.575777] platform 18591000.cpufreq: deferred probe pending
---
 drivers/opp/of.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/opp/of.c +0 -0
index e6d1155d0990..1f0923cc1cd9 100644
@@ -513,11 +513,7 @@ int dev_pm_opp_of_find_icc_paths(struct device *dev,
 	for (i = 0; i < num_paths; i++) {
 		paths[i] = of_icc_get_by_index(dev, i);

drivers/opp/of.c int dev_pm_opp_of_find_icc_paths(struct device *dev, · line 519

Quoted 10 lines
drivers/opp/of.c +1 -5
 		if (IS_ERR(paths[i])) {
-			ret = PTR_ERR(paths[i]);
-			if (ret != -EPROBE_DEFER) {
-				dev_err(dev, "%s: Unable to get path%d: %d\n",
-					__func__, i, ret);
-			}
+			ret = dev_err_probe(dev, ret, "%s: Unable to get path%d\n", __func__, i);
 			goto err;
 		}
 	}

Applied. Thanks.

Signature · 1 line
viresh