Skip to content

Commit 8343794

Browse files
douglas-raillard-armmarcbonnici
authored andcommitted
module/thermal: Gracefully handle unexpected sysfs names
Instead of raising an exception, log an warning and carry on.
1 parent f2bc5db commit 8343794

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

devlib/module/thermal.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ def __init__(self, target):
8888

8989
for entry in target.list_directory(self.thermal_root):
9090
re_match = re.match('^(thermal_zone|cooling_device)([0-9]+)', entry)
91+
if not re_match:
92+
self.logger.warning('unknown thermal entry: %s', entry)
93+
continue
9194

9295
if re_match.group(1) == 'thermal_zone':
9396
self.add_thermal_zone(re_match.group(2))

0 commit comments

Comments
 (0)