V4L/DVB (13975): [STV090x] Added internal structure with shared settings and data.
[safe/jmp/linux-2.6] / drivers / media / dvb / frontends / cx24113.c
index f6e7b03..e9ee555 100644 (file)
@@ -303,6 +303,7 @@ static void cx24113_calc_pll_nf(struct cx24113_state *state, u16 *n, s32 *f)
 {
        s32 N;
        s64 F;
+       u64 dividend;
        u8 R, r;
        u8 vcodiv;
        u8 factor;
@@ -346,7 +347,10 @@ static void cx24113_calc_pll_nf(struct cx24113_state *state, u16 *n, s32 *f)
        F = freq_hz;
        F *= (u64) (R * vcodiv * 262144);
        dprintk("1 N: %d, F: %lld, R: %d\n", N, (long long)F, R);
-       do_div(F, state->config->xtal_khz*1000 * factor * 2);
+       /* do_div needs an u64 as first argument */
+       dividend = F;
+       do_div(dividend, state->config->xtal_khz * 1000 * factor * 2);
+       F = dividend;
        dprintk("2 N: %d, F: %lld, R: %d\n", N, (long long)F, R);
        F -= (N + 32) * 262144;
 
@@ -559,7 +563,7 @@ struct dvb_frontend *cx24113_attach(struct dvb_frontend *fe,
                kzalloc(sizeof(struct cx24113_state), GFP_KERNEL);
        int rc;
        if (state == NULL) {
-               err("Unable to kmalloc\n");
+               err("Unable to kzalloc\n");
                goto error;
        }
 
@@ -585,7 +589,7 @@ struct dvb_frontend *cx24113_attach(struct dvb_frontend *fe,
                info("detected CX24113 variant\n");
                break;
        case REV_CX24113:
-               info("sucessfully detected\n");
+               info("successfully detected\n");
                break;
        default:
                err("unsupported device id: %x\n", state->rev);