diff options
author | Stefan Agner <stefan@agner.ch> | 2016-06-02 12:22:30 -0700 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2017-03-15 18:35:46 +0100 |
commit | 440ef98ad687b210dca17e5c5141b24738f04922 (patch) | |
tree | 036c3507db3d4250cff096e825fc90897e485a3c /arch/arm/common/icst.c | |
parent | de1c77640710e1cca36091c8e6d7947bff2397e7 (diff) | |
parent | 648d744eff1aedea4ffe49dfca07aa465669e1f4 (diff) |
Merge tag 'v4.1.24' into toradex_vf_4.1-next
Linux 4.1.24
Diffstat (limited to 'arch/arm/common/icst.c')
-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 @@ */ #include <linux/module.h> #include <linux/kernel.h> - +#include <asm/div64.h> #include <asm/hardware/icst.h> /* @@ -29,7 +29,11 @@ EXPORT_SYMBOL(icst525_s2div); unsigned long icst_hz(const struct icst_params *p, struct icst_vco vco) { - return p->ref * 2 * (vco.v + 8) / ((vco.r + 2) * p->s2div[vco.s]); + u64 dividend = p->ref * 2 * (u64)(vco.v + 8); + u32 divisor = (vco.r + 2) * p->s2div[vco.s]; + + do_div(dividend, divisor); + return (unsigned long)dividend; } EXPORT_SYMBOL(icst_hz); @@ -58,6 +62,7 @@ icst_hz_to_vco(const struct icst_params *p, unsigned long freq) if (f > p->vco_min && f <= p->vco_max) break; + i++; } while (i < 8); if (i >= 8) |