Re: [PATCH v4 5/7] i2c: designware: Implement I2C_M_STOP support
From: Andi Shyti
Date: Fri Jan 16 2026 - 07:36:44 EST
Hi Benoit,
the patch looks good, just a couple of nits.
...
> @@ -805,18 +792,15 @@ static int i2c_dw_wait_transfer(struct dw_i2c_dev *dev)
> }
>
> /*
> - * Prepare controller for a transaction and call i2c_dw_xfer_msg.
> + * Prepare controller for a transaction, start the transfer of the msgs
> + * and wait for completion, either a STOP or a error.
> + * Return the number of messages transferred or a negative error code.
we are ignoring the number of messages returned, though. Do we
really need it?
> */
> static int
> -i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
> +__i2c_dw_xfer_one_part(struct dw_i2c_dev *dev, struct i2c_msg *msgs, size_t num)
> {
> - struct dw_i2c_dev *dev = i2c_get_adapdata(adap);
> int ret;
>
> - dev_dbg(dev->dev, "%s: msgs: %d\n", __func__, num);
> -
> - pm_runtime_get_sync(dev->dev);
> -
> reinit_completion(&dev->cmd_complete);
> dev->msgs = msgs;
> dev->msgs_num = num;
...
> +/*
> + * Verify that the message at index @idx can be processed as part
> + * of a single transaction. The @msgs array contains the messages
> + * of the transaction. The message is checked against its predecessor
> + * to ensure that it respects the limitation of the controller.
> + */
> +static inline bool
why does this need to be explicitely declared as inline? I don't
think it's necessary.
Thanks,
Andi
> +i2c_dw_msg_is_valid(struct dw_i2c_dev *dev, const struct i2c_msg *msgs, size_t idx)
> +{