Skip to content

Commit 2a808b9

Browse files
Yang Yingliangvireshk
authored andcommitted
cpufreq: dt: Switch to use dev_err_probe() helper
In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. It's more simple in error path. Signed-off-by: Yang Yingliang <[email protected]> Signed-off-by: Viresh Kumar <[email protected]>
1 parent a05887f commit 2a808b9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/cpufreq/cpufreq-dt.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,8 @@ static int dt_cpufreq_early_init(struct device *dev, int cpu)
222222
if (reg_name[0]) {
223223
priv->opp_token = dev_pm_opp_set_regulators(cpu_dev, reg_name);
224224
if (priv->opp_token < 0) {
225-
ret = priv->opp_token;
226-
if (ret != -EPROBE_DEFER)
227-
dev_err(cpu_dev, "failed to set regulators: %d\n",
228-
ret);
225+
ret = dev_err_probe(cpu_dev, priv->opp_token,
226+
"failed to set regulators\n");
229227
goto free_cpumask;
230228
}
231229
}

0 commit comments

Comments
 (0)