diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-06-17 00:55:42 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-06-17 02:39:53 -0400 |
commit | 4c7eb4ebc9001ce343969f58fa538e164e82000b (patch) | |
tree | 44dc6a18d17125b9f215b638e458235cb6e6bc67 | |
parent | 0ec39885b237c35109644f5d8232228026a72715 (diff) |
sh: use kzalloc() for cpg clocks
Convert the shared clock cpg code from bootmem to slab.
Without this patch the current bootmem code triggers
WARN_ON() because the slab is available.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | arch/sh/kernel/cpu/clock-cpg.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/arch/sh/kernel/cpu/clock-cpg.c b/arch/sh/kernel/cpu/clock-cpg.c index 275942e58e4f..6dfe2cced3fc 100644 --- a/arch/sh/kernel/cpu/clock-cpg.c +++ b/arch/sh/kernel/cpu/clock-cpg.c | |||
@@ -1,6 +1,6 @@ | |||
1 | #include <linux/clk.h> | 1 | #include <linux/clk.h> |
2 | #include <linux/compiler.h> | 2 | #include <linux/compiler.h> |
3 | #include <linux/bootmem.h> | 3 | #include <linux/slab.h> |
4 | #include <linux/io.h> | 4 | #include <linux/io.h> |
5 | #include <asm/clock.h> | 5 | #include <asm/clock.h> |
6 | 6 | ||
@@ -127,10 +127,11 @@ int __init sh_clk_div6_register(struct clk *clks, int nr) | |||
127 | int k; | 127 | int k; |
128 | 128 | ||
129 | freq_table_size *= (nr_divs + 1); | 129 | freq_table_size *= (nr_divs + 1); |
130 | 130 | freq_table = kzalloc(freq_table_size * nr, GFP_KERNEL); | |
131 | freq_table = alloc_bootmem(freq_table_size * nr); | 131 | if (!freq_table) { |
132 | if (!freq_table) | 132 | pr_err("sh_clk_div6_register: unable to alloc memory\n"); |
133 | return -ENOMEM; | 133 | return -ENOMEM; |
134 | } | ||
134 | 135 | ||
135 | for (k = 0; !ret && (k < nr); k++) { | 136 | for (k = 0; !ret && (k < nr); k++) { |
136 | clkp = clks + k; | 137 | clkp = clks + k; |
@@ -175,10 +176,11 @@ int __init sh_clk_div4_register(struct clk *clks, int nr, | |||
175 | int k; | 176 | int k; |
176 | 177 | ||
177 | freq_table_size *= (nr_divs + 1); | 178 | freq_table_size *= (nr_divs + 1); |
178 | 179 | freq_table = kzalloc(freq_table_size * nr, GFP_KERNEL); | |
179 | freq_table = alloc_bootmem(freq_table_size * nr); | 180 | if (!freq_table) { |
180 | if (!freq_table) | 181 | pr_err("sh_clk_div4_register: unable to alloc memory\n"); |
181 | return -ENOMEM; | 182 | return -ENOMEM; |
183 | } | ||
182 | 184 | ||
183 | for (k = 0; !ret && (k < nr); k++) { | 185 | for (k = 0; !ret && (k < nr); k++) { |
184 | clkp = clks + k; | 186 | clkp = clks + k; |