Skip to contentSkip to conversation

thermal: thresholds: change thermal_thresholds_init to return void

PATCH New Tudor Ambarus 1 participant 1 message Dec 2, 2025 Thermal

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal: thresholds: change thermal_thresholds_init to return void

The function always returns 0, so change its return type to void and remove the return value check in the caller.

---
 drivers/thermal/thermal_core.c       | 6 +-----
 drivers/thermal/thermal_thresholds.c | 4 +---
 drivers/thermal/thermal_thresholds.h | 2 +-
 3 files changed, 3 insertions(+), 9 deletions(-)
drivers/thermal/thermal_core.c +1 -5
index 17ca5c082643592b46cbbe708c716230fac215ef..05c1e2ff6a0a29e640646132a8d4a0ee63a200a8 100644
@@ -1618,9 +1618,7 @@ thermal_zone_device_register_with_trips(const char *type,
 			goto unregister;
 	}
 
-	result = thermal_thresholds_init(tz);
-	if (result)
-		goto remove_hwmon;
+	thermal_thresholds_init(tz);
 
 	thermal_zone_init_complete(tz);
 
@@ -1630,8 +1628,6 @@ thermal_zone_device_register_with_trips(const char *type,
 
 	return tz;
 
-remove_hwmon:
-	thermal_remove_hwmon_sysfs(tz);
 unregister:
 	device_del(&tz->device);
 release_device:
drivers/thermal/thermal_thresholds.c +1 -3
index 38f5fd0e89303aca32be3c6b11928196b825502b..351f4a464b11df1b64f45f980a349d19a3521b4b 100644
@@ -13,11 +13,9 @@
 #include "thermal_core.h"
 #include "thermal_thresholds.h"
 
-int thermal_thresholds_init(struct thermal_zone_device *tz)
+void thermal_thresholds_init(struct thermal_zone_device *tz)
 {
 	INIT_LIST_HEAD(&tz->user_thresholds);
-
-	return 0;
 }
 
 static void __thermal_thresholds_flush(struct thermal_zone_device *tz)
drivers/thermal/thermal_thresholds.h +1 -1
index cb372659a20d648e92d7800628d29f4343f4137b..5e2629ca369875f4336a2b334fa0da4bcfe9e54b 100644
@@ -8,7 +8,7 @@ struct user_threshold {
 	int direction;
 };
 
-int thermal_thresholds_init(struct thermal_zone_device *tz);
+void thermal_thresholds_init(struct thermal_zone_device *tz);
 void thermal_thresholds_exit(struct thermal_zone_device *tz);
 void thermal_thresholds_handle(struct thermal_zone_device *tz, int *low, int *high);
 void thermal_thresholds_flush(struct thermal_zone_device *tz);

---
base-commit: 63d26c3811421ceeb5b82a85489b88bf545e33c7
change-id: 20251202-th-threshold-init-ce03d234ad4d

Best regards,

Signature · 1 line
Tudor Ambarus <[email protected]>