diff options
author | Hugues Fruchet <hugues.fruchet@st.com> | 2018-01-31 07:46:17 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2018-02-23 03:08:14 -0500 |
commit | 3924c62383ade455d6242f2b017cb67b92aa50a7 (patch) | |
tree | 656952ff1d205b439fdf26bd3a92c716f579f0b5 /drivers/media/i2c/ov5640.c | |
parent | d47c412639f0d283f377ff01d9e6a9cfa44f2adc (diff) | |
download | linux-3924c62383ade455d6242f2b017cb67b92aa50a7.tar.gz linux-3924c62383ade455d6242f2b017cb67b92aa50a7.tar.bz2 linux-3924c62383ade455d6242f2b017cb67b92aa50a7.zip |
media: ov5640: add error trace in case of i2c read failure
Add an error trace in ov5640_read_reg() in case of i2c_transfer()
failure.
Uniformize error traces using dev_err instead v4l2_err.
Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/i2c/ov5640.c')
-rw-r--r-- | drivers/media/i2c/ov5640.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index 99a590263070..6f1846081dbe 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -839,7 +839,7 @@ static int ov5640_write_reg(struct ov5640_dev *sensor, u16 reg, u8 val) ret = i2c_transfer(client->adapter, &msg, 1); if (ret < 0) { - v4l2_err(&sensor->sd, "%s: error: reg=%x, val=%x\n", + dev_err(&client->dev, "%s: error: reg=%x, val=%x\n", __func__, reg, val); return ret; } @@ -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) { + dev_err(&client->dev, "%s: error: reg=%x\n", + __func__, reg); return ret; + } *val = buf[0]; return 0; |