Hi Shunqian Zheng,

On Tue, Jan 09, 2018 at 10:48:21PM +0800, Shunqian Zheng wrote:
> +static int ov5695_write_array(struct i2c_client *client,
> +                           const struct regval *regs)
> +{
> +     u32 i;
> +     int ret = 0;
> +
> +     for (i = 0; ret == 0 && regs[i].addr != REG_NULL; i++)
> +             ret = ov5695_write_reg(client, regs[i].addr,
> +                                    OV5695_REG_VALUE_08BIT, regs[i].val);

This loop should stop on first failure, and return the error value. With 
current code a register write failure is masked by following writes.

> +
> +     return ret;
> +}

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - bar...@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

Reply via email to