mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 13:14:02 +02:00
hwmon: (pmbus/adm1275) Use pmbus_read_smbus_i2c_block_data for block commands
The driver uses i2c_smbus_read_block_data() for PMBus block commands. Use pmbus_read_smbus_i2c_block_data() instead to enable the driver to work with I2C controllers which do not support i2c_smbus_read_block_data(). Drop the functionality check to get an explicit error message if the required SMBus commands are not supported. Reviewed-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
1c5b549f80
commit
5b3dfe24a1
|
|
@ -553,12 +553,7 @@ static int adm1275_probe(struct i2c_client *client)
|
|||
u32 shunt;
|
||||
u32 avg;
|
||||
|
||||
if (!i2c_check_functionality(client->adapter,
|
||||
I2C_FUNC_SMBUS_READ_BYTE_DATA
|
||||
| I2C_FUNC_SMBUS_BLOCK_DATA))
|
||||
return -ENODEV;
|
||||
|
||||
ret = i2c_smbus_read_block_data(client, PMBUS_MFR_ID, block_buffer);
|
||||
ret = pmbus_read_smbus_i2c_block_data(client, PMBUS_MFR_ID, block_buffer);
|
||||
if (ret < 0) {
|
||||
dev_err(&client->dev, "Failed to read Manufacturer ID\n");
|
||||
return ret;
|
||||
|
|
@ -570,7 +565,7 @@ static int adm1275_probe(struct i2c_client *client)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
ret = i2c_smbus_read_block_data(client, PMBUS_MFR_MODEL, block_buffer);
|
||||
ret = pmbus_read_smbus_i2c_block_data(client, PMBUS_MFR_MODEL, block_buffer);
|
||||
if (ret < 0) {
|
||||
dev_err(&client->dev, "Failed to read Manufacturer Model\n");
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user