[media] tda10071: add missing error status when probe() fails
authorAntti Palosaari <crope@iki.fi>
Sat, 6 Jun 2015 11:11:16 +0000 (08:11 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 9 Jun 2015 20:22:28 +0000 (17:22 -0300)
We must return -ENODEV error on case probe() fails to detect chip.

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

index 31328540e5c45d21db516d28410f10d4c61619b8..1470a5d63f581f8374d4e39f51a5d27c2dad515c 100644 (file)
@@ -1348,18 +1348,30 @@ static int tda10071_probe(struct i2c_client *client,
 
        /* chip ID */
        ret = tda10071_rd_reg(dev, 0xff, &u8tmp);
-       if (ret || u8tmp != 0x0f)
+       if (ret)
+               goto err_kfree;
+       if (u8tmp != 0x0f) {
+               ret = -ENODEV;
                goto err_kfree;
+       }
 
        /* chip type */
        ret = tda10071_rd_reg(dev, 0xdd, &u8tmp);
-       if (ret || u8tmp != 0x00)
+       if (ret)
+               goto err_kfree;
+       if (u8tmp != 0x00) {
+               ret = -ENODEV;
                goto err_kfree;
+       }
 
        /* chip version */
        ret = tda10071_rd_reg(dev, 0xfe, &u8tmp);
-       if (ret || u8tmp != 0x01)
+       if (ret)
                goto err_kfree;
+       if (u8tmp != 0x01) {
+               ret = -ENODEV;
+               goto err_kfree;
+       }
 
        /* create dvb_frontend */
        memcpy(&dev->fe.ops, &tda10071_ops, sizeof(struct dvb_frontend_ops));