[PATCH 29/31] hwmon: (pmbus/ucd9000) use 4-argument i2c_smbus_read_block_data()

From: Dmitry Torokhov

Date: Sat Oct 24 2026 - 23:13:42 EST


Pass the buffer size to i2c_smbus_read_block_data() in
ucd9000_get_mfr_status() and ucd9000_probe().

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
---
drivers/hwmon/pmbus/ucd9000.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/hwmon/pmbus/ucd9000.c b/drivers/hwmon/pmbus/ucd9000.c
index f76c2913c9ca..2645d3e78e3f 100644
--- a/drivers/hwmon/pmbus/ucd9000.c
+++ b/drivers/hwmon/pmbus/ucd9000.c
@@ -390,7 +390,8 @@ static int ucd9000_get_mfr_status(struct i2c_client *client, u8 *buffer)
if (ret < 0)
return ret;

- return i2c_smbus_read_block_data(client, UCD9000_MFR_STATUS, buffer);
+ return i2c_smbus_read_block_data(client, UCD9000_MFR_STATUS,
+ I2C_SMBUS_BLOCK_MAX, buffer);
}

static int ucd9000_debugfs_show_mfr_status_bit(void *data, u64 *val)
@@ -515,7 +516,7 @@ static int ucd9000_probe(struct i2c_client *client)
return -ENODEV;

ret = i2c_smbus_read_block_data(client, UCD9000_DEVICE_ID,
- block_buffer);
+ sizeof(block_buffer) - 1, block_buffer);
if (ret < 0) {
dev_err(&client->dev, "Failed to read device ID\n");
return ret;
@@ -565,7 +566,7 @@ static int ucd9000_probe(struct i2c_client *client)

/* Everything else is configurable */
ret = i2c_smbus_read_block_data(client, UCD9000_MONITOR_CONFIG,
- block_buffer);
+ sizeof(block_buffer) - 1, block_buffer);
if (ret <= 0) {
dev_err(&client->dev, "Failed to read configuration data\n");
return -ENODEV;
@@ -602,6 +603,7 @@ static int ucd9000_probe(struct i2c_client *client)
UCD9000_FAN_CONFIG_INDEX, i);
ret = i2c_smbus_read_block_data(client,
UCD9000_FAN_CONFIG,
+ sizeof(data->fan_data[i]),
data->fan_data[i]);
if (ret < 0)
return ret;

--
2.56.0.257.gf7497c7d27-goog