[CPUFREQ] move policy's governor initialisation out of low-level drivers into cpufreq...
[linux-2.6-block.git] / arch / i386 / kernel / cpu / cpufreq / sc520_freq.c
index ef457d50f4acaa7a43285197587596ece75637db..d9f3e90a7ae080c9ba1e316c56ccb3afe6022231 100644 (file)
@@ -111,7 +111,6 @@ static int sc520_freq_cpu_init(struct cpufreq_policy *policy)
                return -ENODEV;
 
        /* cpuinfo and default policy values */
-       policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
        policy->cpuinfo.transition_latency = 1000000; /* 1ms */
        policy->cur = sc520_freq_get_cpu_frequency(0);
 
@@ -153,6 +152,7 @@ static struct cpufreq_driver sc520_freq_driver = {
 static int __init sc520_freq_init(void)
 {
        struct cpuinfo_x86 *c = cpu_data;
+       int err;
 
        /* Test if we have the right hardware */
        if(c->x86_vendor != X86_VENDOR_AMD ||
@@ -166,7 +166,11 @@ static int __init sc520_freq_init(void)
                return -ENOMEM;
        }
 
-       return cpufreq_register_driver(&sc520_freq_driver);
+       err = cpufreq_register_driver(&sc520_freq_driver);
+       if (err)
+               iounmap(cpuctl);
+
+       return err;
 }