Re: [PATCH v3 04/14] i2c-octeon: Support I2C_M_RECV_LEN

From: Wolfram Sang
Date: Sat Mar 12 2016 - 10:45:22 EST


On Mon, Mar 07, 2016 at 04:10:47PM +0100, Jan Glauber wrote:
> From: David Daney <david.daney@xxxxxxxxxx>
>
> If I2C_M_RECV_LEN is set consider the length byte.
>
> Signed-off-by: David Daney <ddaney@xxxxxxxxxxxxxxxxxx>
> Signed-off-by: Jan Glauber <jglauber@xxxxxxxxxx>

You also might want to set "| I2C_FUNC_SMBUS_READ_BLOCK_DATA |
I2C_FUNC_SMBUS_BLOCK_PROC_CALL" in your functionality?

> + if (recv_len && i == 0) {
> + if (data[i] > I2C_SMBUS_BLOCK_MAX + 1) {
> + dev_err(i2c->dev,
> + "%s: read len > I2C_SMBUS_BLOCK_MAX %d\n",
> + __func__, data[i]);
> + return -EIO;

According to Documentation/i2c/fault-codes this should be -EPROTO.

Attachment: signature.asc
Description: PGP signature