Skip to content

Commit

Permalink
sh: clock div4 frequency table offset fix
Browse files Browse the repository at this point in the history
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 <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Magnus Damm authored and Paul Mundt committed Jun 11, 2009
1 parent cf9fe11 commit a50de78
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/sh/kernel/cpu/clock-cpg.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ int __init sh_clk_div4_register(struct clk *clks, int nr,
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;

Expand Down

0 comments on commit a50de78

Please sign in to comment.