MIPS: ath79: Use a helper function to get system clock rates

The ath79 platform uses similar code to get the
rate of various clocks during init. Separate the
similar code into a new helper function and use
that to avoid code duplication.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5778/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
Gabor Juhos
2013-08-28 10:41:44 +02:00
committed by Ralf Baechle
orang tua 837f036c8a
melakukan 2310780244
4 mengubah file dengan 25 tambahan dan 11 penghapusan

Melihat File

@@ -209,13 +209,11 @@ void __init plat_mem_setup(void)
void __init plat_time_init(void)
{
struct clk *clk;
unsigned long cpu_clk_rate;
clk = clk_get(NULL, "cpu");
if (IS_ERR(clk))
panic("unable to get CPU clock, err=%ld", PTR_ERR(clk));
cpu_clk_rate = ath79_get_sys_clk_rate("cpu");
mips_hpt_frequency = clk_get_rate(clk) / 2;
mips_hpt_frequency = cpu_clk_rate / 2;
}
static int __init ath79_setup(void)