Commit 6f901a99 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by 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: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: default avatarVaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: default avatarDouglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 480be185
...@@ -272,7 +272,7 @@ static int tvp514x_read_reg(struct v4l2_subdev *sd, u8 reg) ...@@ -272,7 +272,7 @@ static int tvp514x_read_reg(struct v4l2_subdev *sd, u8 reg)
read_again: read_again:
err = i2c_smbus_read_byte_data(client, reg); err = i2c_smbus_read_byte_data(client, reg);
if (err == -1) { if (err < 0) {
if (retry <= I2C_RETRY_COUNT) { if (retry <= I2C_RETRY_COUNT) {
v4l2_warn(sd, "Read: retry ... %d\n", retry); v4l2_warn(sd, "Read: retry ... %d\n", retry);
retry++; retry++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment