cpufreq: qoirq: Don't validate the frequency table twice
authorViresh Kumar <viresh.kumar@linaro.org>
Mon, 26 Feb 2018 05:09:01 +0000 (10:39 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 20 Mar 2018 11:07:52 +0000 (12:07 +0100)
The cpufreq core is already validating the CPU frequency table after
calling the ->init() callback of the cpufreq drivers and the drivers
don't need to do the same anymore. Though they need to set the
policy->freq_table field directly from the ->init() callback now.

Stop validating the frequency table from qoirq driver.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/qoriq-cpufreq.c

index ee3e3656485b4c3e29bab9dc5c5ce1a69fc40ada..3d773f64b4df7e8f0b30e109ef1c865dfdd5ee44 100644 (file)
@@ -165,7 +165,7 @@ static void freq_table_sort(struct cpufreq_frequency_table *freq_table,
 static int qoriq_cpufreq_cpu_init(struct cpufreq_policy *policy)
 {
        struct device_node *np;
-       int i, count, ret;
+       int i, count;
        u32 freq;
        struct clk *clk;
        const struct clk_hw *hwclk;
@@ -209,14 +209,7 @@ static int qoriq_cpufreq_cpu_init(struct cpufreq_policy *policy)
        freq_table_redup(table, count);
        freq_table_sort(table, count);
        table[i].frequency = CPUFREQ_TABLE_END;
-
-       /* set the min and max frequency properly */
-       ret = cpufreq_table_validate_and_show(policy, table);
-       if (ret) {
-               pr_err("invalid frequency table: %d\n", ret);
-               goto err_nomem1;
-       }
-
+       policy->freq_table = table;
        data->table = table;
 
        /* update ->cpus if we have cluster, no harm if not */
@@ -232,8 +225,6 @@ static int qoriq_cpufreq_cpu_init(struct cpufreq_policy *policy)
 
        return 0;
 
-err_nomem1:
-       kfree(table);
 err_pclk:
        kfree(data->pclk);
 err_nomem2: