thermal: thresholds: change thermal_thresholds_init to return void
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.
Signed-off-by Tudor Ambarus <[email protected]>
--- 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
@@ -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
@@ -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
@@ -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]>