Re: [PATCH v11 2/2] i2c: amlogic: Add Amlogic A9 I2C controller driver
From: Markus Elfring
Date: Wed Nov 18 2026 - 04:41:28 EST
…
> +++ b/drivers/i2c/busses/i2c-amlogic-a9.c
> @@ -0,0 +1,428 @@
…
> +static int aml_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
> +{
> + struct aml_i2c *i2c = adap->algo_data;
> + int i, ret = 0;
How do you think about to omit the initialisation for the variable “ret”
in such a function implementation?
> +
> + for (i = 0; i < num; i++) {
> + ret = aml_i2c_xfer_msg(i2c, msgs + i, i == num - 1);
> + if (ret)
> + return ret;
> + }
> +
> + return i;
> +}
…
Regards,
Markus