Add an error trace in ov5640_read_reg() in case of i2c_transfer() failure. Signed-off-by: Hugues Fruchet <hugues.fruchet@xxxxxx> --- drivers/media/i2c/ov5640.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index 99a5902..882a7c3 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -868,8 +868,11 @@ static int ov5640_read_reg(struct ov5640_dev *sensor, u16 reg, u8 *val) msg[1].len = 1; ret = i2c_transfer(client->adapter, msg, 2); - if (ret < 0) + if (ret < 0) { + v4l2_err(&sensor->sd, "%s: error: reg=%x\n", + __func__, reg); return ret; + } *val = buf[0]; return 0; -- 1.9.1