Skip to content

Commit

Permalink
V4L/DVB (13292): tvp514x: recognize the error case in tvp514x_read_reg()
Browse files Browse the repository at this point in the history
i2c_smbus_read_byte_data() returns a negative value on error. It is very
likely to be != -1 (-EPERM).

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Sebastian Andrzej Siewior authored and Mauro Carvalho Chehab committed Dec 5, 2009
1 parent 480be18 commit 6f901a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/video/tvp514x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down

0 comments on commit 6f901a9

Please sign in to comment.