vserver 1.9.5.x5
[linux-2.6.git] / arch / i386 / kernel / cpu / cpufreq / gx-suspmod.c
index 1f855c5..1a49adb 100644 (file)
@@ -141,17 +141,7 @@ module_param (max_duration, int, 0444);
 #define POLICY_MIN_DIV 20
 
 
-/* DEBUG
- *   Define it if you want verbose debug output
- */
-
-#define SUSPMOD_DEBUG 1
-
-#ifdef SUSPMOD_DEBUG
-#define dprintk(msg...) printk(KERN_DEBUG "cpufreq:" msg)
-#else
-#define dprintk(msg...) do { } while(0)
-#endif
+#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "gx-suspmod", msg)
 
 /**
  *      we can detect a core multipiler from dir0_lsb 
@@ -194,18 +184,18 @@ static __init struct pci_dev *gx_detect_chipset(void)
        /* check if CPU is a MediaGX or a Geode. */
         if ((current_cpu_data.x86_vendor != X86_VENDOR_NSC) && 
            (current_cpu_data.x86_vendor != X86_VENDOR_CYRIX)) {
-               printk(KERN_INFO "gx-suspmod: error: no MediaGX/Geode processor found!\n");
+               dprintk("error: no MediaGX/Geode processor found!\n");
                return NULL;            
        }
 
        /* detect which companion chip is used */
-       while ((gx_pci = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, gx_pci)) != NULL) {
+       while ((gx_pci = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, gx_pci)) != NULL) {
                if ((pci_match_device (gx_chipset_tbl, gx_pci)) != NULL) {
                        return gx_pci;
                }
        }
 
-       dprintk(KERN_INFO "gx-suspmod: error: no supported chipset found!\n");
+       dprintk("error: no supported chipset found!\n");
        return NULL;
 }
 
@@ -219,7 +209,7 @@ static unsigned int gx_get_cpuspeed(unsigned int cpu)
        if ((gx_params->pci_suscfg & SUSMOD) == 0) 
                return stock_freq;
 
-       return (stock_freq * gx_params->on_duration) 
+       return (stock_freq * gx_params->off_duration) 
                / (gx_params->on_duration + gx_params->off_duration);
 }
 
@@ -499,6 +489,7 @@ static int __init cpufreq_gx_init(void)
 static void __exit cpufreq_gx_exit(void)
 {
        cpufreq_unregister_driver(&gx_suspmod_driver);
+       pci_dev_put(gx_params->cs55x0);
        kfree(gx_params);
 }