]> Pileus Git - ~andy/linux/blobdiff - drivers/cpufreq/ppc-corenet-cpufreq.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
[~andy/linux] / drivers / cpufreq / ppc-corenet-cpufreq.c
index 3f7be46d2b27ac1f5dc362d85c08697d5530dea2..051000f44ca2c788a839326ce4e99b81d90f82fb 100644 (file)
 
 /**
  * struct cpu_data - per CPU data struct
- * @clk: the clk of CPU
  * @parent: the parent node of cpu clock
  * @table: frequency table
  */
 struct cpu_data {
-       struct clk *clk;
        struct device_node *parent;
        struct cpufreq_frequency_table *table;
 };
@@ -81,13 +79,6 @@ static inline const struct cpumask *cpu_core_mask(int cpu)
 }
 #endif
 
-static unsigned int corenet_cpufreq_get_speed(unsigned int cpu)
-{
-       struct cpu_data *data = per_cpu(cpu_data, cpu);
-
-       return clk_get_rate(data->clk) / 1000;
-}
-
 /* reduce the duplicated frequencies in frequency table */
 static void freq_table_redup(struct cpufreq_frequency_table *freq_table,
                int count)
@@ -158,8 +149,8 @@ static int corenet_cpufreq_cpu_init(struct cpufreq_policy *policy)
                goto err_np;
        }
 
-       data->clk = of_clk_get(np, 0);
-       if (IS_ERR(data->clk)) {
+       policy->clk = of_clk_get(np, 0);
+       if (IS_ERR(policy->clk)) {
                pr_err("%s: no clock information\n", __func__);
                goto err_nomem2;
        }
@@ -255,7 +246,7 @@ static int corenet_cpufreq_target(struct cpufreq_policy *policy,
        struct cpu_data *data = per_cpu(cpu_data, policy->cpu);
 
        parent = of_clk_get(data->parent, data->table[index].driver_data);
-       return clk_set_parent(data->clk, parent);
+       return clk_set_parent(policy->clk, parent);
 }
 
 static struct cpufreq_driver ppc_corenet_cpufreq_driver = {
@@ -265,7 +256,7 @@ static struct cpufreq_driver ppc_corenet_cpufreq_driver = {
        .exit           = __exit_p(corenet_cpufreq_cpu_exit),
        .verify         = cpufreq_generic_frequency_table_verify,
        .target_index   = corenet_cpufreq_target,
-       .get            = corenet_cpufreq_get_speed,
+       .get            = cpufreq_generic_get,
        .attr           = cpufreq_generic_attr,
 };