diff options
| -rw-r--r-- | arch/arm/common/icst.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm/common/icst.c b/arch/arm/common/icst.c index 2dc6da70ae59..d7ed252708c5 100644 --- a/arch/arm/common/icst.c +++ b/arch/arm/common/icst.c | |||
| @@ -16,7 +16,7 @@ | |||
| 16 | */ | 16 | */ |
| 17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
| 18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
| 19 | 19 | #include <asm/div64.h> | |
| 20 | #include <asm/hardware/icst.h> | 20 | #include <asm/hardware/icst.h> |
| 21 | 21 | ||
| 22 | /* | 22 | /* |
| @@ -29,7 +29,11 @@ EXPORT_SYMBOL(icst525_s2div); | |||
| 29 | 29 | ||
| 30 | unsigned long icst_hz(const struct icst_params *p, struct icst_vco vco) | 30 | unsigned long icst_hz(const struct icst_params *p, struct icst_vco vco) |
| 31 | { | 31 | { |
| 32 | return p->ref * 2 * (vco.v + 8) / ((vco.r + 2) * p->s2div[vco.s]); | 32 | u64 dividend = p->ref * 2 * (u64)(vco.v + 8); |
| 33 | u32 divisor = (vco.r + 2) * p->s2div[vco.s]; | ||
| 34 | |||
| 35 | do_div(dividend, divisor); | ||
| 36 | return (unsigned long)dividend; | ||
| 33 | } | 37 | } |
| 34 | 38 | ||
| 35 | EXPORT_SYMBOL(icst_hz); | 39 | EXPORT_SYMBOL(icst_hz); |
| @@ -58,6 +62,7 @@ icst_hz_to_vco(const struct icst_params *p, unsigned long freq) | |||
| 58 | 62 | ||
| 59 | if (f > p->vco_min && f <= p->vco_max) | 63 | if (f > p->vco_min && f <= p->vco_max) |
| 60 | break; | 64 | break; |
| 65 | i++; | ||
| 61 | } while (i < 8); | 66 | } while (i < 8); |
| 62 | 67 | ||
| 63 | if (i >= 8) | 68 | if (i >= 8) |
