[media] it913x: avoid division by zero on error case
authorAntti Palosaari <crope@iki.fi>
Sat, 9 Aug 2014 15:35:00 +0000 (12:35 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Sun, 21 Sep 2014 20:23:45 +0000 (17:23 -0300)
Error on init leaves some internal divisor zero, which causes oops
later. Fix it by populating divisors even it fails.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/tuners/tuner_it913x.c

index 3265d9ab3c671b943a7576f6e3b686cded99c9e3..cd20c5b0f07ea99eaf854ef54b4671fb1b229f96 100644 (file)
@@ -154,6 +154,9 @@ static int it913x_init(struct dvb_frontend *fe)
                val = 16;
                break;
        case -ENODEV:
+               /* FIXME: these are just avoid divide by 0 */
+               state->tun_xtal = 2000;
+               state->tun_fdiv = 3;
                return -ENODEV;
        case 1:
        default: