summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTodor Tomov <todor.tomov@linaro.org>2018-02-08 04:41:59 -0500
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-05-17 06:22:08 -0400
commit706487807377ae276c3d0f45347b3702d791da12 (patch)
treef776d3a57a6cbdd42a04b849757298f5299117a2
parentce96bcf5b4dbd91795870b81d5f80d5257e9cb4c (diff)
downloadtalos-op-linux-706487807377ae276c3d0f45347b3702d791da12.tar.gz
talos-op-linux-706487807377ae276c3d0f45347b3702d791da12.zip
media: ov5645: Fix write_reg return code
I2C transfer functions return number of successful operations (on success). Do not return the received positive return code but instead return 0 on success. The users of write_reg function already use this logic. Signed-off-by: Todor Tomov <todor.tomov@linaro.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r--drivers/media/i2c/ov5645.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c
index 4e3142a7e5a7..b3f762578f7f 100644
--- a/drivers/media/i2c/ov5645.c
+++ b/drivers/media/i2c/ov5645.c
@@ -600,11 +600,13 @@ static int ov5645_write_reg(struct ov5645 *ov5645, u16 reg, u8 val)
regbuf[2] = val;
ret = i2c_master_send(ov5645->i2c_client, regbuf, 3);
- if (ret < 0)
+ if (ret < 0) {
dev_err(ov5645->dev, "%s: write reg error %d: reg=%x, val=%x\n",
__func__, ret, reg, val);
+ return ret;
+ }
- return ret;
+ return 0;
}
static int ov5645_read_reg(struct ov5645 *ov5645, u16 reg, u8 *val)
OpenPOWER on IntegriCloud