[media] qm1d1c0042: fix compilation on 32 bits
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Wed, 24 Sep 2014 01:29:41 +0000 (22:29 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Fri, 26 Sep 2014 09:47:42 +0000 (06:47 -0300)
   drivers/built-in.o: In function `qm1d1c0042_set_params':
>> qm1d1c0042.c:(.text+0x2519730): undefined reference to `__divdi3'

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/tuners/qm1d1c0042.c

index 585594b9c4f83376ec699691e7bed27d067251ba..18bc745ed1080169fc4aacd5cfe630140e49ec10 100644 (file)
@@ -28,6 +28,7 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/math64.h>
 #include "qm1d1c0042.h"
 
 #define QM1D1C0042_NUM_REGS 0x20
@@ -234,7 +235,9 @@ static int qm1d1c0042_set_params(struct dvb_frontend *fe)
         * sd = b          (b >= 0)
         *      1<<22 + b  (b < 0)
         */
-       b = (((s64) freq) << 20) / state->cfg.xtal_freq - (((s64) a) << 20);
+       b = (s32)div64_s64(((s64) freq) << 20, state->cfg.xtal_freq)
+                          - (((s64) a) << 20);
+
        if (b >= 0)
                sd = b;
        else