mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-17 05:45:20 +00:00
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>
This commit is contained in:
parent
9502108876
commit
a15ffa783e
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user