[media] r820t: Don't put it in standby if not initialized yet
authorMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 11 Apr 2013 16:25:10 +0000 (13:25 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 17 Apr 2013 00:36:56 +0000 (21:36 -0300)
r820t_standby() can be called before r820t_init().
If that happens, just do nothing.

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

index fc660f27edb3e9a786c18f5d2f16201a037b2280..b679a3f1fb7aad5fbe10cc480ac7b0aee56f5190 100644 (file)
@@ -1298,6 +1298,10 @@ static int r820t_standby(struct r820t_priv *priv)
 {
        int rc;
 
+       /* If device was not initialized yet, don't need to standby */
+       if (!priv->init_done)
+               return 0;
+
        rc = r820t_write_reg(priv, 0x06, 0xb1);
        if (rc < 0)
                return rc;