

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/i386/kernel/cpu/cpufreq/longhaul.c |   27 ++++++++++++------------
 1 files changed, 14 insertions(+), 13 deletions(-)

diff -puN arch/i386/kernel/cpu/cpufreq/longhaul.c~longhaul-fix arch/i386/kernel/cpu/cpufreq/longhaul.c
--- 25/arch/i386/kernel/cpu/cpufreq/longhaul.c~longhaul-fix	2004-07-27 00:51:37.398152592 -0700
+++ 25-akpm/arch/i386/kernel/cpu/cpufreq/longhaul.c	2004-07-27 00:54:04.241828960 -0700
@@ -100,23 +100,24 @@ static int longhaul_get_cpu_mult(void)
 }
 
 
-static void do_powersaver(int version)
+static void do_powersaver(union msr_longhaul *longhaul,
+			unsigned int clock_ratio_index, int version)
 {
-	rdmsrl (MSR_VIA_LONGHAUL, longhaul.val);
-	longhaul.bits.SoftBusRatio = clock_ratio_index & 0xf;
-	longhaul.bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4;
-	longhaul.bits.EnableSoftBusRatio = 1;
-	longhaul.bits.RevisionKey = 0;
+	rdmsrl(MSR_VIA_LONGHAUL, longhaul->val);
+	longhaul->bits.SoftBusRatio = clock_ratio_index & 0xf;
+	longhaul->bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4;
+	longhaul->bits.EnableSoftBusRatio = 1;
+	longhaul->bits.RevisionKey = 0;
 	local_irq_disable();
-	wrmsrl(MSR_VIA_LONGHAUL, longhaul.val);
+	wrmsrl(MSR_VIA_LONGHAUL, longhaul->val);
 	local_irq_enable();
 	__hlt();
 
-	rdmsrl (MSR_VIA_LONGHAUL, longhaul.val);
-	longhaul.bits.EnableSoftBusRatio = 0;
-	longhaul.bits.RevisionKey = version;
+	rdmsrl(MSR_VIA_LONGHAUL, longhaul->val);
+	longhaul->bits.EnableSoftBusRatio = 0;
+	longhaul->bits.RevisionKey = version;
 	local_irq_disable();
-	wrmsrl (MSR_VIA_LONGHAUL, longhaul.val);
+	wrmsrl(MSR_VIA_LONGHAUL, longhaul->val);
 	local_irq_enable();
 }
 
@@ -188,7 +189,7 @@ static void longhaul_setstate(unsigned i
 	 * of scaling (like we do in powernow-k7.c)
 	 */
 	case 2:
-		do_powersaver(3);
+		do_powersaver(&longhaul, clock_ratio_index, 3);
 		break;
 
 	/*
@@ -198,7 +199,7 @@ static void longhaul_setstate(unsigned i
 	 * to work in practice.
 	 */
 	case 3:
-		do_powersaver(0xf);
+		do_powersaver(&longhaul, clock_ratio_index, 0xf);
 		break;
 	}
 
_
