Skip to content

Commit 1250c1a

Browse files
Alexandre Olivarafaeljw
authored andcommitted
cpufreq: loongson2_cpufreq: adjust cpufreq uses of LOONGSON_CHIPCFG
The post-fork cleanup of loongson2ef from loongson64 changed LOONGSON_CHIPCFG from a single-argument functional macro to a non-functional macro with an mmio address in loongson2ef, but loongson2_cpufreq still uses the notation of a functional macro call expecting it to be an lvalue. Fixed based on loongson_suspend_enter. Signed-off-by: Alexandre Oliva <[email protected]> Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 731e6b9 commit 1250c1a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/cpufreq/loongson2_cpufreq.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,11 @@ static void loongson2_cpu_wait(void)
144144
u32 cpu_freq;
145145

146146
spin_lock_irqsave(&loongson2_wait_lock, flags);
147-
cpu_freq = LOONGSON_CHIPCFG(0);
148-
LOONGSON_CHIPCFG(0) &= ~0x7; /* Put CPU into wait mode */
149-
LOONGSON_CHIPCFG(0) = cpu_freq; /* Restore CPU state */
147+
cpu_freq = readl(LOONGSON_CHIPCFG);
148+
/* Put CPU into wait mode */
149+
writel(readl(LOONGSON_CHIPCFG) & ~0x7, LOONGSON_CHIPCFG);
150+
/* Restore CPU state */
151+
writel(cpu_freq, LOONGSON_CHIPCFG);
150152
spin_unlock_irqrestore(&loongson2_wait_lock, flags);
151153
local_irq_enable();
152154
}

0 commit comments

Comments
 (0)