sh: clock div4 frequency table offset fix
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.
Signed-off-by Magnus Damm <[email protected]>
---
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 cint 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 ;