summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx18/cx18-av-core.c
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-05-29 19:54:02 -0400
committerAndy Walls <awalls@radix.net>2009-05-29 19:54:02 -0400
commit3d5f82276e18a37806603a52b23d18c8b60b5d01 (patch)
tree4b5157bc37bcc30ff4f47cb3d8ad141af7fe167a /linux/drivers/media/video/cx18/cx18-av-core.c
parente0dc20d13b71daf0612373420a45246e6566d61f (diff)
downloadmediapointer-dvb-s2-3d5f82276e18a37806603a52b23d18c8b60b5d01.tar.gz
mediapointer-dvb-s2-3d5f82276e18a37806603a52b23d18c8b60b5d01.tar.bz2
cx18: Perform 64 bit divide so it works for 32 bit systems
From: Andy Walls <awalls@radix.net> Thanks to David Ward and Mike Krufky for reporting the problem and debugging this as an unresolved symbol due to a 64 bit divide on a 32 bit system. David Ward provided the content of this patch; Andy Walls only performed some cosmetic edits. Reported-by: David Ward <david.ward@gatech.edu> Priority: normal Signed-off-by: David Ward <david.ward@gatech.edu> Signed-off-by: Andy Walls <awalls@radix.net>
Diffstat (limited to 'linux/drivers/media/video/cx18/cx18-av-core.c')
-rw-r--r--linux/drivers/media/video/cx18/cx18-av-core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/linux/drivers/media/video/cx18/cx18-av-core.c b/linux/drivers/media/video/cx18/cx18-av-core.c
index 0b3d840cc..536dedb23 100644
--- a/linux/drivers/media/video/cx18/cx18-av-core.c
+++ b/linux/drivers/media/video/cx18/cx18-av-core.c
@@ -447,6 +447,7 @@ void cx18_av_std_setup(struct cx18 *cx)
if (pll_post) {
int fsc, pll;
+ u64 tmp;
pll = (28636360L * ((((u64)pll_int) << 25) + pll_frac)) >> 25;
pll /= pll_post;
@@ -459,7 +460,9 @@ void cx18_av_std_setup(struct cx18 *cx)
"= %d.%03d\n", src_decimation / 256,
((src_decimation % 256) * 1000) / 256);
- fsc = ((((u64)sc) * 28636360)/src_decimation) >> 13L;
+ tmp = 28636360 * (u64) sc;
+ do_div(tmp, src_decimation);
+ fsc = tmp >> 13;
CX18_DEBUG_INFO_DEV(sd,
"Chroma sub-carrier initial freq = %d.%06d "
"MHz\n", fsc / 1000000, fsc % 1000000);