Skip to content

Commit a15ffa7

Browse files
committed
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 <[email protected]> Acked-by: Daniel Lezcano <[email protected]>
1 parent 9502108 commit a15ffa7

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

drivers/thermal/thermal_trip.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ int for_each_thermal_trip(struct thermal_zone_device *tz,
1717

1818
lockdep_assert_held(&tz->lock);
1919

20-
if (!tz->trips)
21-
return -ENODATA;
22-
2320
for (i = 0; i < tz->num_trips; i++) {
2421
ret = cb(&tz->trips[i], data);
2522
if (ret)

0 commit comments

Comments
 (0)