[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250805125003.12573-2-artyom.shimko@gmail.com>
Date: Tue, 5 Aug 2025 15:43:57 +0300
From: "a.shimko" <artyom.shimko@...il.com>
To: linux-hwmon@...r.kernel.org
Cc: "a.shimko" <artyom.shimko@...il.com>,
linux-kernel@...r.kernel.org,
sudeep.holla@....com,
cristian.marussi@....com,
jdelvare@...e.com,
guenter.roeck@...ux.com
Subject: [PATCH 1/3] hwmon: scmi: Add default case with debug output
From: Artem Shimko <artyom.shimko@...il.com>
Improve handling of unsupported sensor types:
- Add default case in sensor type switch statement
- Log skipped sensors with debug information including:
* Sensor ID
* Sensor type
* Sensor name (if available)
- Use rate-limited dev_dbg for safety
Debug output format:
"Skipping unsupported sensor ID:%d Type:%d (%s)"
Signed-off-by: Artem Shimko <artyom.shimko@...il.com>
---
drivers/hwmon/scmi-hwmon.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/hwmon/scmi-hwmon.c b/drivers/hwmon/scmi-hwmon.c
index 364199b332c0..a3b5b5c0ec25 100644
--- a/drivers/hwmon/scmi-hwmon.c
+++ b/drivers/hwmon/scmi-hwmon.c
@@ -275,6 +275,10 @@ static int scmi_hwmon_probe(struct scmi_device *sdev)
nr_count[type]++;
break;
}
+ default:
+ dev_dbg(dev, "Skipping unsupported sensor ID:%d Type:%d (%s)\n",
+ i, sensor->type, sensor->name ? sensor->name : "unnamed");
+ continue;
}
if (nr_count[hwmon_temp])
@@ -323,6 +327,10 @@ static int scmi_hwmon_probe(struct scmi_device *sdev)
idx = --nr_count[type];
*(scmi_sensors->info[type] + idx) = sensor;
break;
+ default:
+ dev_dbg(dev, "Skipping unsupported sensor ID:%d Type:%d (%s)\n",
+ i, sensor->type, sensor->name ? sensor->name : "unnamed");
+ continue;
}
}
--
2.43.0
Powered by blists - more mailing lists