提交 f18a36cf 编写于 作者: S Sudeep Holla 提交者: Guenter Roeck

hwmon: (scmi) handle absence of few types of sensors

Currently the loop checks for non-zero count of sensors for each type
of sensors which is completely wrong. It also results in aborting the
registration of sensors if one or more types of sensors are completely
not supported by the platform SCMI firmware.

This patch fixes the issue by continue to loop and skiping sensor types
that are not present.

Fixes: b23688ae ("hwmon: add support for sensors exported via ARM SCMI")
Reported-by: NJim Quinlan <james.quinlan@broadcom.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
上级 6d08b06e
...@@ -170,7 +170,10 @@ static int scmi_hwmon_probe(struct scmi_device *sdev) ...@@ -170,7 +170,10 @@ static int scmi_hwmon_probe(struct scmi_device *sdev)
scmi_chip_info.info = ptr_scmi_ci; scmi_chip_info.info = ptr_scmi_ci;
chip_info = &scmi_chip_info; chip_info = &scmi_chip_info;
for (type = 0; type < hwmon_max && nr_count[type]; type++) { for (type = 0; type < hwmon_max; type++) {
if (!nr_count[type])
continue;
scmi_hwmon_add_chan_info(scmi_hwmon_chan, dev, nr_count[type], scmi_hwmon_add_chan_info(scmi_hwmon_chan, dev, nr_count[type],
type, hwmon_attributes[type]); type, hwmon_attributes[type]);
*ptr_scmi_ci++ = scmi_hwmon_chan++; *ptr_scmi_ci++ = scmi_hwmon_chan++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册