[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220908152449.35457-4-farbere@amazon.com>
Date: Thu, 8 Sep 2022 15:24:31 +0000
From: Eliav Farber <farbere@...zon.com>
To: <jdelvare@...e.com>, <linux@...ck-us.net>, <robh+dt@...nel.org>,
<p.zabel@...gutronix.de>, <rtanwar@...linear.com>,
<andriy.shevchenko@...el.com>, <linux-hwmon@...r.kernel.org>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC: <farbere@...zon.com>, <hhhawa@...zon.com>, <jonnyc@...zon.com>,
"Andy Shevchenko" <andriy.shevchenko@...ux.intel.com>
Subject: [PATCH v5 03/21] 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@...zon.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
V4 -> v3:
- Update also vm_num to actual number of VMs.
drivers/hwmon/mr75203.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hwmon/mr75203.c b/drivers/hwmon/mr75203.c
index 81ccb4c6fa5c..62df0c9498f3 100644
--- a/drivers/hwmon/mr75203.c
+++ b/drivers/hwmon/mr75203.c
@@ -605,6 +605,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;
}
}
--
2.37.1
Powered by blists - more mailing lists