From 5b3dfe24a1a87110302504e543daa3f9e165eac5 Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Sat, 1 Aug 2026 18:41:26 -0700 Subject: [PATCH] hwmon: (pmbus/adm1275) Use pmbus_read_smbus_i2c_block_data for block commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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á Signed-off-by: Guenter Roeck --- drivers/hwmon/pmbus/adm1275.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/hwmon/pmbus/adm1275.c b/drivers/hwmon/pmbus/adm1275.c index 174f9bcba7e2..beb32a878d1c 100644 --- a/drivers/hwmon/pmbus/adm1275.c +++ b/drivers/hwmon/pmbus/adm1275.c @@ -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;