thermal: trip: Drop redundant trips check from for_each_thermal_trip()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 19 Sep 2023 18:59:53 +0000 (20:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Feb 2024 00:19:10 +0000 (16:19 -0800)
commit3a3bbc6911f57e1c3b4eabf1d098cde7bf7baeb0
treef415315cb2cd13fc848d61dbfe030dfc04355836
parentcca763863768cebd93b942c739aa67dadb5b4114
thermal: trip: Drop redundant trips check from for_each_thermal_trip()

[ Upstream commit a15ffa783ea4210877886c59566a0d20f6b2bc09 ]

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>
Stable-dep-of: e95fa7404716 ("thermal: gov_power_allocator: avoid inability to reset a cdev")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/thermal/thermal_trip.c