From 1754a5d9f97f16f729066b8f125351af4951d6fe Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 23 Nov 2007 11:28:11 +0800 Subject: Blackfin arch: use do_div() for the 64bit division as pointed out by Bernd If you need a 64 bit divide in the kernel, use asm/div64.h. Revert the addition of udivdi3. Cc: Bernd Schmidt Signed-off-by: Mike Frysinger Signed-off-by: Bryan Wu --- arch/blackfin/kernel/setup.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'arch/blackfin/kernel') diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c index dfe06b09a9d4..eee5a1fcb64c 100644 --- a/arch/blackfin/kernel/setup.c +++ b/arch/blackfin/kernel/setup.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -504,13 +505,17 @@ EXPORT_SYMBOL(get_sclk); unsigned long sclk_to_usecs(unsigned long sclk) { - return (USEC_PER_SEC * (u64)sclk) / get_sclk(); + u64 tmp = USEC_PER_SEC * (u64)sclk; + do_div(tmp, get_sclk()); + return tmp; } EXPORT_SYMBOL(sclk_to_usecs); unsigned long usecs_to_sclk(unsigned long usecs) { - return (get_sclk() * (u64)usecs) / USEC_PER_SEC; + u64 tmp = get_sclk() * (u64)usecs; + do_div(tmp, USEC_PER_SEC); + return tmp; } EXPORT_SYMBOL(usecs_to_sclk); -- cgit v1.2.2