提交 ab80b19b 编写于 作者: A Antti Palosaari 提交者: Mauro Carvalho Chehab

[media] tda10071: add missing error status when probe() fails

We must return -ENODEV error on case probe() fails to detect chip.
Signed-off-by: NAntti Palosaari <crope@iki.fi>
Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
上级 4347df6a
...@@ -1348,18 +1348,30 @@ static int tda10071_probe(struct i2c_client *client, ...@@ -1348,18 +1348,30 @@ static int tda10071_probe(struct i2c_client *client,
/* chip ID */ /* chip ID */
ret = tda10071_rd_reg(dev, 0xff, &u8tmp); ret = tda10071_rd_reg(dev, 0xff, &u8tmp);
if (ret || u8tmp != 0x0f) if (ret)
goto err_kfree;
if (u8tmp != 0x0f) {
ret = -ENODEV;
goto err_kfree; goto err_kfree;
}
/* chip type */ /* chip type */
ret = tda10071_rd_reg(dev, 0xdd, &u8tmp); ret = tda10071_rd_reg(dev, 0xdd, &u8tmp);
if (ret || u8tmp != 0x00) if (ret)
goto err_kfree;
if (u8tmp != 0x00) {
ret = -ENODEV;
goto err_kfree; goto err_kfree;
}
/* chip version */ /* chip version */
ret = tda10071_rd_reg(dev, 0xfe, &u8tmp); ret = tda10071_rd_reg(dev, 0xfe, &u8tmp);
if (ret || u8tmp != 0x01) if (ret)
goto err_kfree; goto err_kfree;
if (u8tmp != 0x01) {
ret = -ENODEV;
goto err_kfree;
}
/* create dvb_frontend */ /* create dvb_frontend */
memcpy(&dev->fe.ops, &tda10071_ops, sizeof(struct dvb_frontend_ops)); memcpy(&dev->fe.ops, &tda10071_ops, sizeof(struct dvb_frontend_ops));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册