[media] af9035: add log writing if unsupported Xtal freq is given
authorAntti Palosaari <crope@iki.fi>
Sun, 1 Apr 2012 17:13:36 +0000 (14:13 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 9 Apr 2012 17:44:59 +0000 (14:44 -0300)
Supports currently only 12 MHz Xtals. It is better to print log
and not to attach frontend in that case.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/frontends/af9033.c

index 40ef4b1faebcea7d58c58786172a0907a15728bd..277255481607b33a4649d27544af8c9df5c5d94f 100644 (file)
@@ -667,6 +667,13 @@ struct dvb_frontend *af9033_attach(const struct af9033_config *config,
        state->i2c = i2c;
        memcpy(&state->cfg, config, sizeof(struct af9033_config));
 
+       if (state->cfg.clock != 12000000) {
+               printk(KERN_INFO "af9033: unsupported clock=%d, only " \
+                               "12000000 Hz is supported currently\n",
+                               state->cfg.clock);
+               goto err;
+       }
+
        /* firmware version */
        ret = af9033_rd_regs(state, 0x0083e9, &buf[0], 4);
        if (ret < 0)