On 12/22, Viresh Kumar wrote:
OPP layer manages it now and cpufreq-dt driver doesn't need it. But, we still need to check for availability of resources for deferred probing.
Why? It seems cleaner to let OPP layer return an error indicating probe defer or failure when we try to initialize it. That way we aren't duplicating the same logic in two places to figure out if a regulator or clock is ready.
Signed-off-by: Viresh Kumar viresh.kumar@linaro.org @@ -95,8 +90,8 @@ static int allocate_resources(int cpu, struct device **cdev, * not yet registered, we should try defering probe. */ if (PTR_ERR(cpu_reg) == -EPROBE_DEFER) {
dev_dbg(cpu_dev, "cpu%d regulator not ready, retry\n",
cpu);
dev_dbg(cpu_dev, "cpu%s regulator not ready, retry\n",
Should that just be "%s regulator not ready"?
}reg); return -EPROBE_DEFER;
@@ -241,9 +234,7 @@ static int cpufreq_init(struct cpufreq_policy *policy) } priv->cpu_dev = cpu_dev;
- priv->cpu_reg = cpu_reg; policy->driver_data = priv;
- policy->clk = cpu_clk;
Maybe we can have an dev_pm_opp_get_rate() API and a cpufreq_generic_opp_get() so we can get rid of policy->clk usage in this driver?
rcu_read_lock();