aboutsummaryrefslogtreecommitdiff
path: root/drivers/thermal/thermal_trip.c
diff options
context:
space:
mode:
authorGravatar Rafael J. Wysocki <rafael.j.wysocki@intel.com> 2023-09-19 20:59:53 +0200
committerGravatar Rafael J. Wysocki <rafael.j.wysocki@intel.com> 2023-09-26 17:59:53 +0200
commita15ffa783ea4210877886c59566a0d20f6b2bc09 (patch)
tree9761e6265af25f5f910df0a2908bb84ad94384b0 /drivers/thermal/thermal_trip.c
parentthermal: core: Drop trips_disabled bitmask (diff)
downloadlinux-a15ffa783ea4210877886c59566a0d20f6b2bc09.tar.gz
linux-a15ffa783ea4210877886c59566a0d20f6b2bc09.tar.bz2
linux-a15ffa783ea4210877886c59566a0d20f6b2bc09.zip
thermal: trip: Drop redundant trips check from for_each_thermal_trip()
It is invalid to call for_each_thermal_trip() on an unregistered thermal zone anyway, and as per thermal_zone_device_register_with_trips(), the trips[] table must be present if num_trips is greater than zero for the given thermal zone. Hence, the trips check in for_each_thermal_trip() is redundant and so it can be dropped. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'drivers/thermal/thermal_trip.c')
-rw-r--r--drivers/thermal/thermal_trip.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/thermal/thermal_trip.c b/drivers/thermal/thermal_trip.c
index 024e2e365a26..1cadb3b5d104 100644
--- a/drivers/thermal/thermal_trip.c
+++ b/drivers/thermal/thermal_trip.c
@@ -17,9 +17,6 @@ int for_each_thermal_trip(struct thermal_zone_device *tz,
lockdep_assert_held(&tz->lock);
- if (!tz->trips)
- return -ENODATA;
-
for (i = 0; i < tz->num_trips; i++) {
ret = cb(&tz->trips[i], data);
if (ret)