[PATCH 1/2] hwmon: (pmbus/max31785) fix argument type for i2c_smbus_write_byte_data wrapper

Sanman Pradhan posted 2 patches 1 month ago
There is a newer version of this series
[PATCH 1/2] hwmon: (pmbus/max31785) fix argument type for i2c_smbus_write_byte_data wrapper
Posted by Sanman Pradhan 1 month ago
From: Sanman Pradhan <psanman@juniper.net>

The local wrapper max31785_i2c_write_byte_data() declares its data
parameter as u16 but passes it directly to i2c_smbus_write_byte_data()
which takes u8. Fix the type to match the underlying API.

No functional change; all current callers pass values that fit in u8.

Signed-off-by: Sanman Pradhan <psanman@juniper.net>
---
 drivers/hwmon/pmbus/max31785.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/pmbus/max31785.c b/drivers/hwmon/pmbus/max31785.c
index 1f94d38a1637..50073fe0c5e8 100644
--- a/drivers/hwmon/pmbus/max31785.c
+++ b/drivers/hwmon/pmbus/max31785.c
@@ -55,7 +55,7 @@ static inline void max31785_wait(const struct max31785_data *data)
 
 static int max31785_i2c_write_byte_data(struct i2c_client *client,
 					struct max31785_data *driver_data,
-					int command, u16 data)
+					int command, u8 data)
 {
 	int rc;
 
-- 
2.34.1
Re: [PATCH 1/2] hwmon: (pmbus/max31785) fix argument type for i2c_smbus_write_byte_data wrapper
Posted by Guenter Roeck 1 month ago
On Sat, Mar 07, 2026 at 02:45:19PM -0800, Sanman Pradhan wrote:
> From: Sanman Pradhan <psanman@juniper.net>
> 
> The local wrapper max31785_i2c_write_byte_data() declares its data
> parameter as u16 but passes it directly to i2c_smbus_write_byte_data()
> which takes u8. Fix the type to match the underlying API.
> 
> No functional change; all current callers pass values that fit in u8.
> 
> Signed-off-by: Sanman Pradhan <psanman@juniper.net>

Applied.

Thanks,
Guenter