From 34ddd8c2117c3fbfba9171f1906341912d135063 Mon Sep 17 00:00:00 2001 From: Artem Shimko Date: Thu, 31 Jul 2025 16:09:31 +0300 Subject: [PATCH v1 1/4] hwmon: scmi: Add default case with debug output 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 --- 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