summaryrefslogtreecommitdiff
path: root/drivers/hwmon/mr75203.c
diff options
context:
space:
mode:
authorEliav Farber <farbere@amazon.com>2022-09-08 15:24:31 +0000
committerGuenter Roeck <linux@roeck-us.net>2022-09-08 11:54:44 -0700
commitbb9195bd6664d94d71647631593e09f705ff5edd (patch)
treef836015c7fe3386b5764e827e3380145358f86db /drivers/hwmon/mr75203.c
parent81114fc3d27bf5b06b2137d2fd2b63da656a8b90 (diff)
hwmon: (mr75203) update pvt->v_num and vm_num to the actual number of used sensors
This issue is relevant when "intel,vm-map" is set in device-tree, and defines a lower number of VMs than actually supported. This change is needed for all places that use pvt->v_num or vm_num later on in the code. Fixes: 9d823351a337 ("hwmon: Add hardware monitoring driver for Moortec MR75203 PVT controller") Signed-off-by: Eliav Farber <farbere@amazon.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20220908152449.35457-4-farbere@amazon.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/mr75203.c')
-rw-r--r--drivers/hwmon/mr75203.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/hwmon/mr75203.c b/drivers/hwmon/mr75203.c
index 8b72e8fe34c1..be02f32bf143 100644
--- a/drivers/hwmon/mr75203.c
+++ b/drivers/hwmon/mr75203.c
@@ -595,6 +595,8 @@ static int mr75203_probe(struct platform_device *pdev)
if (pvt->vm_idx[i] >= vm_num ||
pvt->vm_idx[i] == 0xff) {
num = i;
+ pvt->v_num = i;
+ vm_num = i;
break;
}
}