diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2022-08-30 13:32:36 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-09-24 10:05:25 +0300 |
commit | 54bb7671ca6de58929b3994468c330bedb9a3b7e (patch) | |
tree | a345d45f1a591db85c69fc82eec3aaf432865b26 | |
parent | 2ba3e38517f5a4ebf9c997168079dca01b7f9fc6 (diff) | |
download | linux-54bb7671ca6de58929b3994468c330bedb9a3b7e.tar.xz |
media: ar0521: Fix return value check in writing initial registers
The return value from register writes is ignored apart from the last
value. Fix this.
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
-rw-r--r-- | drivers/media/i2c/ar0521.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/i2c/ar0521.c b/drivers/media/i2c/ar0521.c index 9e90b02b15e3..a586e0fc0ea3 100644 --- a/drivers/media/i2c/ar0521.c +++ b/drivers/media/i2c/ar0521.c @@ -755,11 +755,12 @@ static int ar0521_power_on(struct device *dev) gpiod_set_value(sensor->reset_gpio, 0); usleep_range(4500, 5000); /* min 45000 clocks */ - for (cnt = 0; cnt < ARRAY_SIZE(initial_regs); cnt++) + for (cnt = 0; cnt < ARRAY_SIZE(initial_regs); cnt++) { ret = ar0521_write_regs(sensor, initial_regs[cnt].data, initial_regs[cnt].count); if (ret) goto off; + } ret = ar0521_write_reg(sensor, AR0521_REG_SERIAL_FORMAT, AR0521_REG_SERIAL_FORMAT_MIPI | |