diff options
author | Mike Frysinger <michael.frysinger@analog.com> | 2007-11-22 22:28:11 -0500 |
---|---|---|
committer | Bryan Wu <bryan.wu@analog.com> | 2007-11-22 22:28:11 -0500 |
commit | 1754a5d9f97f16f729066b8f125351af4951d6fe (patch) | |
tree | cb19d854eb21c6db5de9de804ba08859b3e531ab /arch/blackfin/kernel | |
parent | e709d84b99e03b0ff588d7754754c507e5543fc9 (diff) |
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 <bernd.schmidt@analog.com>
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch/blackfin/kernel')
-rw-r--r-- | arch/blackfin/kernel/setup.c | 9 |
1 files changed, 7 insertions, 2 deletions
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 @@ | |||
43 | #include <asm/cacheflush.h> | 43 | #include <asm/cacheflush.h> |
44 | #include <asm/blackfin.h> | 44 | #include <asm/blackfin.h> |
45 | #include <asm/cplbinit.h> | 45 | #include <asm/cplbinit.h> |
46 | #include <asm/div64.h> | ||
46 | #include <asm/fixed_code.h> | 47 | #include <asm/fixed_code.h> |
47 | #include <asm/early_printk.h> | 48 | #include <asm/early_printk.h> |
48 | 49 | ||
@@ -504,13 +505,17 @@ EXPORT_SYMBOL(get_sclk); | |||
504 | 505 | ||
505 | unsigned long sclk_to_usecs(unsigned long sclk) | 506 | unsigned long sclk_to_usecs(unsigned long sclk) |
506 | { | 507 | { |
507 | return (USEC_PER_SEC * (u64)sclk) / get_sclk(); | 508 | u64 tmp = USEC_PER_SEC * (u64)sclk; |
509 | do_div(tmp, get_sclk()); | ||
510 | return tmp; | ||
508 | } | 511 | } |
509 | EXPORT_SYMBOL(sclk_to_usecs); | 512 | EXPORT_SYMBOL(sclk_to_usecs); |
510 | 513 | ||
511 | unsigned long usecs_to_sclk(unsigned long usecs) | 514 | unsigned long usecs_to_sclk(unsigned long usecs) |
512 | { | 515 | { |
513 | return (get_sclk() * (u64)usecs) / USEC_PER_SEC; | 516 | u64 tmp = get_sclk() * (u64)usecs; |
517 | do_div(tmp, USEC_PER_SEC); | ||
518 | return tmp; | ||
514 | } | 519 | } |
515 | EXPORT_SYMBOL(usecs_to_sclk); | 520 | EXPORT_SYMBOL(usecs_to_sclk); |
516 | 521 | ||