aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-06-10 12:26:18 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-06-10 12:26:18 -0300
commit87b09bd048924f5b830d57f719b0c62ec25bac32 (patch)
tree2aaa3e8f6c515e7dedf472af087d78d0d309420a /drivers/media/dvb-frontends
parent9d605e6359f0808581b89350c643208586f41a06 (diff)
ts2020: fix compilation on i386
drivers/built-in.o: In function `ts2020_read_signal_strength': ts2020.c:(.text+0x298ff94): undefined reference to `__divdi3' ts2020.c:(.text+0x298ffd4): undefined reference to `__divdi3' ts2020.c:(.text+0x298fffd): undefined reference to `__divdi3' Makefile:921: recipe for target 'vmlinux' failed Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/dvb-frontends')
-rw-r--r--drivers/media/dvb-frontends/ts2020.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/media/dvb-frontends/ts2020.c b/drivers/media/dvb-frontends/ts2020.c
index 946d8e9502fd..f61b143a0052 100644
--- a/drivers/media/dvb-frontends/ts2020.c
+++ b/drivers/media/dvb-frontends/ts2020.c
@@ -22,6 +22,7 @@
#include "dvb_frontend.h"
#include "ts2020.h"
#include <linux/regmap.h>
+#include <linux/math64.h>
#define TS2020_XTAL_FREQ 27000 /* in kHz */
#define FREQ_OFFSET_LOW_SYM_RATE 3000
@@ -483,13 +484,13 @@ static int ts2020_read_signal_strength(struct dvb_frontend *fe,
strength = 0;
else if (gain < -65000)
/* 0% - 60%: weak signal */
- strength = 0 + (85000 + gain) * 3 / 1000;
+ strength = 0 + div64_s64((85000 + gain) * 3, 1000);
else if (gain < -45000)
/* 60% - 90%: normal signal */
- strength = 60 + (65000 + gain) * 3 / 2000;
+ strength = 60 + div64_s64((65000 + gain) * 3, 2000);
else
/* 90% - 99%: strong signal */
- strength = 90 + (45000 + gain) / 5000;
+ strength = 90 + div64_s64((45000 + gain), 5000);
*_signal_strength = strength * 65535 / 100;
return 0;

Privacy Policy