OSDN Git Service

eeprom: ee1004: Improve check for SMBUS features
authorHeiner Kallweit <hkallweit1@gmail.com>
Mon, 24 May 2021 20:12:22 +0000 (22:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 May 2021 12:49:39 +0000 (14:49 +0200)
commit08e5138aa419350d0a168abeac3ecec4b7e779be
tree1042810c665fdea41482054711138703cb91a88e
parentb97ba92e2962b7ede713bc5b70dcf747083e45f9
eeprom: ee1004: Improve check for SMBUS features

We have to read 512 bytes only, therefore read performance isn't really
a concern. Don't bother the user if i2c block read isn't supported.

For i2c_smbus_read_i2c_block_data_or_emulated() to work it's sufficient
if I2C_FUNC_SMBUS_READ_I2C_BLOCK or I2C_FUNC_SMBUS_READ_BYTE_DATA is
supported. Therefore remove the check for I2C_FUNC_SMBUS_READ_WORD_DATA.

In addition check for I2C_FUNC_SMBUS_WRITE_BYTE (included in
I2C_FUNC_SMBUS_BYTE) which is needed for setting the page.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/840c668e-6310-e933-e50e-5abeaecfb39c@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/eeprom/ee1004.c