X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fi386%2Fkernel%2Fcpu%2Fcpufreq%2Fgx-suspmod.c;h=1a49adb1f4a68c41798583c4232d480f6a523376;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=1f855c54c4a63a756c0d70c0c0104d2f5a4edd40;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c index 1f855c54c..1a49adb1f 100644 --- a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c +++ b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c @@ -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); }