提交 6f901a99 编写于 作者: S Sebastian Andrzej Siewior 提交者: Mauro Carvalho Chehab

V4L/DVB (13292): tvp514x: recognize the error case in tvp514x_read_reg()

i2c_smbus_read_byte_data() returns a negative value on error. It is very
likely to be != -1 (-EPERM).
Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: NVaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: NDouglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 480be185
......@@ -272,7 +272,7 @@ static int tvp514x_read_reg(struct v4l2_subdev *sd, u8 reg)
read_again:
err = i2c_smbus_read_byte_data(client, reg);
if (err == -1) {
if (err < 0) {
if (retry <= I2C_RETRY_COUNT) {
v4l2_warn(sd, "Read: retry ... %d\n", retry);
retry++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册