linux-mips
[Top] [All Lists]

[PATCH 2/6] MIPS: ath79: use local ref clock rate in ar934x_get_pll_freq

To: Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH 2/6] MIPS: ath79: use local ref clock rate in ar934x_get_pll_freq
From: Gabor Juhos <juhosg@openwrt.org>
Date: Wed, 28 Aug 2013 10:41:43 +0200
Cc: linux-mips@linux-mips.org, Gabor Juhos <juhosg@openwrt.org>
In-reply-to: <1377679307-429-1-git-send-email-juhosg@openwrt.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1377679307-429-1-git-send-email-juhosg@openwrt.org>
Sender: linux-mips-bounce@linux-mips.org
The reference clock rate is passed in the first
argument of the function. Use that instead of the
rate of the global ath79_ref_clk variable.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
 arch/mips/ath79/clock.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/ath79/clock.c b/arch/mips/ath79/clock.c
index 733017b..4378d63 100644
--- a/arch/mips/ath79/clock.c
+++ b/arch/mips/ath79/clock.c
@@ -174,12 +174,12 @@ static u32 __init ar934x_get_pll_freq(u32 ref, u32 
ref_div, u32 nint, u32 nfrac,
        u64 t;
        u32 ret;
 
-       t = ath79_ref_clk.rate;
+       t = ref;
        t *= nint;
        do_div(t, ref_div);
        ret = t;
 
-       t = ath79_ref_clk.rate;
+       t = ref;
        t *= nfrac;
        do_div(t, ref_div * frac);
        ret += t;
-- 
1.7.10

<Prev in Thread] Current Thread [Next in Thread>