Re: [PATCH v7] iio: humidity: ens210: Extend I2C functionality check
From: Stepan Ionichev
Date: Sun May 17 2026 - 03:39:11 EST
On Fri, May 16, 2026, Jonathan Cameron wrote:
> Sashiko pointed this out... Take a look at definition of I2C_FUNC_SMBUS_BYTE_DATA
> and consider if the line above makes sense. Check for other instances of
> this.
grep across the driver shows what actually gets called:
i2c_smbus_read_byte_data -> I2C_FUNC_SMBUS_READ_BYTE_DATA
i2c_smbus_write_byte_data -> I2C_FUNC_SMBUS_WRITE_BYTE_DATA
i2c_smbus_read_word_data -> I2C_FUNC_SMBUS_READ_WORD_DATA
i2c_smbus_read_i2c_block_data -> I2C_FUNC_SMBUS_READ_I2C_BLOCK
i2c_smbus_write_byte() (without _data) is not called anywhere in the
driver, so the WRITE_BYTE flag in the current mask is dead. WORD_DATA
asks for both read and write word data, but only the read side is used.
Minimal correct mask:
I2C_FUNC_SMBUS_BYTE_DATA | /* read + write byte data */
I2C_FUNC_SMBUS_READ_WORD_DATA |
I2C_FUNC_SMBUS_READ_I2C_BLOCK
Stepan