@@ -104,6 +104,9 @@ static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev)
snprintf(name, MAX_NAME_LEN, "speed%d", speed);
for_each_possible_cpu(cpu) {
+ struct dev_pm_opp_config config = {
+ .prop_name = name,
+ };
struct device *cpu_dev = get_cpu_device(cpu);
if (!cpu_dev) {
@@ -111,10 +114,10 @@ static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev)
goto free_opp;
}
- opp_tables[cpu] = dev_pm_opp_set_prop_name(cpu_dev, name);
+ opp_tables[cpu] = dev_pm_opp_set_config(cpu_dev, &config);
if (IS_ERR(opp_tables[cpu])) {
ret = PTR_ERR(opp_tables[cpu]);
- pr_err("Failed to set prop name\n");
+ pr_err("Failed to set OPP config\n");
goto free_opp;
}
}
@@ -133,7 +136,7 @@ static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev)
for_each_possible_cpu(cpu) {
if (IS_ERR_OR_NULL(opp_tables[cpu]))
break;
- dev_pm_opp_put_prop_name(opp_tables[cpu]);
+ dev_pm_opp_clear_config(opp_tables[cpu]);
}
kfree(opp_tables);
@@ -148,7 +151,7 @@ static int sun50i_cpufreq_nvmem_remove(struct platform_device *pdev)
platform_device_unregister(cpufreq_dt_pdev);
for_each_possible_cpu(cpu)
- dev_pm_opp_put_prop_name(opp_tables[cpu]);
+ dev_pm_opp_clear_config(opp_tables[cpu]);
kfree(opp_tables);
The OPP core now provides a unified API for setting all configuration types, i.e. dev_pm_opp_set_config(). Lets start using it. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> --- drivers/cpufreq/sun50i-cpufreq-nvmem.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)