[CPUFREQ] Remove pointless reinitialisation from powernow-k8
[linux-drm-fsl-dcu.git] / arch / i386 / kernel / cpu / cpufreq / powernow-k8.c
index 7c0e160a214503e44a8209fc000900e23b5b9010..517de6cb0d0a711066d22d632e3106286d652ff8 100644 (file)
@@ -20,7 +20,7 @@
  *  of the "BIOS and Kernel Developer's Guide for the AMD Athlon 64 and AMD
  *  Opteron Processors" available for download from www.amd.com
  *
- *  Tables for specific CPUs can be infrerred from
+ *  Tables for specific CPUs can be inferred from
  *     http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/30430.pdf
  */
 
@@ -896,7 +896,7 @@ static int transition_frequency(struct powernow_k8_data *data, unsigned int inde
        for_each_cpu_mask(i, cpu_core_map[data->cpu]) {
                freqs.cpu = i;
                cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
-        }
+       }
        return res;
 }
 
@@ -905,14 +905,17 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
 {
        cpumask_t oldmask = CPU_MASK_ALL;
        struct powernow_k8_data *data = powernow_data[pol->cpu];
-       u32 checkfid = data->currfid;
-       u32 checkvid = data->currvid;
+       u32 checkfid;
+       u32 checkvid;
        unsigned int newstate;
        int ret = -EIO;
 
        if (!data)
                return -EINVAL;
 
+       checkfid = data->currfid;
+       checkvid = data->currvid;
+
        /* only run on specific CPU from here on */
        oldmask = current->cpus_allowed;
        set_cpus_allowed(current, cpumask_of_cpu(pol->cpu));
@@ -930,10 +933,8 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
        dprintk("targ: cpu %d, %d kHz, min %d, max %d, relation %d\n",
                pol->cpu, targfreq, pol->min, pol->max, relation);
 
-       if (query_current_values_with_pending_wait(data)) {
-               ret = -EIO;
+       if (query_current_values_with_pending_wait(data))
                goto err_out;
-       }
 
        dprintk("targ: curr fid 0x%x, vid 0x%x\n",
                data->currfid, data->currvid);
@@ -1106,9 +1107,6 @@ static unsigned int powernowk8_get (unsigned int cpu)
 
        data = powernow_data[first_cpu(cpu_core_map[cpu])];
 
-       if (!data)
-               return -EINVAL;
-
        if (!data)
                return -EINVAL;