aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-05-29 19:54:02 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-16 17:21:16 -0400
commit9ad4c6551b8540054f51b483ce513ccb87f8181b (patch)
tree44027d83a752158fa3d3e0864a761672552877f0 /drivers
parent75c74d1c78ec3b713a986e0efc645ed558384cdf (diff)
V4L/DVB (11898): cx18: Perform 64 bit divide so it works for 32 bit systems
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> Signed-off-by: David Ward <david.ward@gatech.edu> Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/cx18/cx18-av-core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/video/cx18/cx18-av-core.c b/drivers/media/video/cx18/cx18-av-core.c
index 0b3d840cc2e2..536dedb23ba3 100644
--- a/drivers/media/video/cx18/cx18-av-core.c
+++ b/drivers/media/video/cx18/cx18-av-core.c
@@ -447,6 +447,7 @@ void cx18_av_std_setup(struct cx18 *cx)
447 447
448 if (pll_post) { 448 if (pll_post) {
449 int fsc, pll; 449 int fsc, pll;
450 u64 tmp;
450 451
451 pll = (28636360L * ((((u64)pll_int) << 25) + pll_frac)) >> 25; 452 pll = (28636360L * ((((u64)pll_int) << 25) + pll_frac)) >> 25;
452 pll /= pll_post; 453 pll /= pll_post;
@@ -459,7 +460,9 @@ void cx18_av_std_setup(struct cx18 *cx)
459 "= %d.%03d\n", src_decimation / 256, 460 "= %d.%03d\n", src_decimation / 256,
460 ((src_decimation % 256) * 1000) / 256); 461 ((src_decimation % 256) * 1000) / 256);
461 462
462 fsc = ((((u64)sc) * 28636360)/src_decimation) >> 13L; 463 tmp = 28636360 * (u64) sc;
464 do_div(tmp, src_decimation);
465 fsc = tmp >> 13;
463 CX18_DEBUG_INFO_DEV(sd, 466 CX18_DEBUG_INFO_DEV(sd,
464 "Chroma sub-carrier initial freq = %d.%06d " 467 "Chroma sub-carrier initial freq = %d.%06d "
465 "MHz\n", fsc / 1000000, fsc % 1000000); 468 "MHz\n", fsc / 1000000, fsc % 1000000);