Skip to contentSkip to conversation

sh: clock div4 frequency table offset fix

PATCH New Magnus Damm 1 participant 1 message Jun 2, 2009 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sh: clock div4 frequency table offset fix

From: Magnus Damm <[email protected]>

This patch fixes the per clock offset calculation in sh_clk_div4_register(). Without this patch the offset to the frequency table for each clock is incorrect.

---

 arch/sh/kernel/cpu/clock-cpg.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/sh/kernel/cpu/clock-cpg.c +3 -2
@@ -71,8 +71,9 @@ int __init sh_clk_div4_register(struct c
 	int ret = 0;
 	int k;
 
-	k = nr_divs + 1;
-	freq_table = alloc_bootmem(freq_table_size * nr * (nr_divs + 1));
+	freq_table_size *= (nr_divs + 1);
+
+	freq_table = alloc_bootmem(freq_table_size * nr);
 	if (!freq_table)
 		return -ENOMEM;