]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/sparc64/kernel/us3_cpufreq.c
Merge branch 'master'
[linux-2.6-omap-h63xx.git] / arch / sparc64 / kernel / us3_cpufreq.c
index 9080e7cd4bb0b8506ceea663c6e4e0d5a4f8a87e..47e3acafb5be4c0f0786bbe12fd2b353334f4d92 100644 (file)
@@ -203,29 +203,31 @@ static int __init us3_freq_init(void)
        unsigned long manuf, impl, ver;
        int ret;
 
+       if (tlb_type != cheetah && tlb_type != cheetah_plus)
+               return -ENODEV;
+
        __asm__("rdpr %%ver, %0" : "=r" (ver));
        manuf = ((ver >> 48) & 0xffff);
        impl  = ((ver >> 32) & 0xffff);
 
        if (manuf == CHEETAH_MANUF &&
-           (impl == CHEETAH_IMPL || impl == CHEETAH_PLUS_IMPL)) {
+           (impl == CHEETAH_IMPL ||
+            impl == CHEETAH_PLUS_IMPL ||
+            impl == JAGUAR_IMPL ||
+            impl == PANTHER_IMPL)) {
                struct cpufreq_driver *driver;
 
                ret = -ENOMEM;
-               driver = kmalloc(sizeof(struct cpufreq_driver), GFP_KERNEL);
+               driver = kzalloc(sizeof(struct cpufreq_driver), GFP_KERNEL);
                if (!driver)
                        goto err_out;
-               memset(driver, 0, sizeof(*driver));
 
-               us3_freq_table = kmalloc(
+               us3_freq_table = kzalloc(
                        (NR_CPUS * sizeof(struct us3_freq_percpu_info)),
                        GFP_KERNEL);
                if (!us3_freq_table)
                        goto err_out;
 
-               memset(us3_freq_table, 0,
-                      (NR_CPUS * sizeof(struct us3_freq_percpu_info)));
-
                driver->init = us3_freq_cpu_init;
                driver->verify = us3_freq_verify;
                driver->target = us3_freq_target;
@@ -246,10 +248,8 @@ err_out:
                        kfree(driver);
                        cpufreq_us3_driver = NULL;
                }
-               if (us3_freq_table) {
-                       kfree(us3_freq_table);
-                       us3_freq_table = NULL;
-               }
+               kfree(us3_freq_table);
+               us3_freq_table = NULL;
                return ret;
        }
 
@@ -260,7 +260,6 @@ static void __exit us3_freq_exit(void)
 {
        if (cpufreq_us3_driver) {
                cpufreq_unregister_driver(cpufreq_us3_driver);
-
                kfree(cpufreq_us3_driver);
                cpufreq_us3_driver = NULL;
                kfree(us3_freq_table);