diff mbox series

[09/16] hwmon: max20740: Fix type incompatibility with non-macro find_closest

Message ID 20250515081332.151250-10-asoponar@taladin.ro
State New
Headers show
Series [01/16] hwmon: w83795: Fix type incompatibility with non-macro find_closest | expand

Commit Message

Alexandru Soponar May 15, 2025, 8:13 a.m. UTC
The max_current array was previously declared as u32 but used with
find_closest(). With find_closest() now implemented as a function taking
signed int parameters instead of a macro, passing unsigned arrays causes
type incompatibility errors. This patch changes the array type from u32
to int to ensure compatibility with the function signature and prevent
compilation errors.

Signed-off-by: Alexandru Soponar <asoponar@taladin.ro>
---
 drivers/hwmon/pmbus/max20730.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/hwmon/pmbus/max20730.c b/drivers/hwmon/pmbus/max20730.c
index 95869d198ecf..0e8d292e9ff4 100644
--- a/drivers/hwmon/pmbus/max20730.c
+++ b/drivers/hwmon/pmbus/max20730.c
@@ -436,7 +436,7 @@  static long direct_to_val(u16 w, enum pmbus_sensor_classes class,
 	return d;
 }
 
-static u32 max_current[][5] = {
+static int max_current[][5] = {
 	[max20710] = { 6200, 8000, 9700, 11600 },
 	[max20730] = { 13000, 16600, 20100, 23600 },
 	[max20734] = { 21000, 27000, 32000, 38000 },
@@ -449,7 +449,7 @@  static int max20730_read_word_data(struct i2c_client *client, int page,
 	const struct pmbus_driver_info *info = pmbus_get_driver_info(client);
 	const struct max20730_data *data = to_max20730_data(info);
 	int ret = 0;
-	u32 max_c;
+	int max_c;
 
 	switch (reg) {
 	case PMBUS_OT_FAULT_LIMIT: