aboutsummaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2016-03-14 14:26:30 +0800
committerAlex Shi <alex.shi@linaro.org>2016-03-14 14:26:30 +0800
commit82211c838b558293e48c8fcd816f6609ebc7e4b3 (patch)
tree1075d29efa4b2c71780986674c7052d16208ea6e /arch/arm
parent8fdeb0be4a89d1a869481ea847773513686b49ed (diff)
parent0f67c5beb42a8328e9e661dcfcc4d328b6138264 (diff)
Merge tag 'v3.18.28' into linux-linaro-lsk-v3.18
This is the 3.18.28 stable release
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/common/icst.c9
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)