thermal/of: Remove of_thermal_is_trip_valid()
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Mon, 3 Oct 2022 09:25:50 +0000 (11:25 +0200)
committerDaniel Lezcano <daniel.lezcano@kernel.org>
Fri, 6 Jan 2023 13:14:47 +0000 (14:14 +0100)
There is no benefit with the of_thermal_is_trip_valid() function as it
does the check the thermal_zone_get_trip() is already doing for the
sake of getting the trip point.

As all the calls have been replaced by thermal_zone_get_trip(), there
is no more users of of_thermal_is_trip_valid().

Remove the function.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20221003092602.1323944-18-daniel.lezcano@linaro.org
drivers/thermal/thermal_core.h
drivers/thermal/thermal_of.c

index 6cda4a180e12fa6aa5424d9ee81b9bd07d28b403..26350206a98dae3702c3e123050941e8e9db709b 100644 (file)
@@ -139,16 +139,6 @@ thermal_cooling_device_stats_update(struct thermal_cooling_device *cdev,
 #endif /* CONFIG_THERMAL_STATISTICS */
 
 /* device tree support */
-#ifdef CONFIG_THERMAL_OF
-bool of_thermal_is_trip_valid(struct thermal_zone_device *, int);
-#else
-static inline bool of_thermal_is_trip_valid(struct thermal_zone_device *tz,
-                                           int trip)
-{
-       return false;
-}
-#endif
-
 int thermal_zone_device_is_enabled(struct thermal_zone_device *tz);
 
 #endif /* __THERMAL_CORE_H__ */
index 6cb3b59cab6ddb412622c2d696f20450ad32c07f..d6fe349b3c5a5eebfd689c70c4635c5393815832 100644 (file)
 
 #include "thermal_core.h"
 
-/**
- * of_thermal_is_trip_valid - function to check if trip point is valid
- *
- * @tz:        pointer to a thermal zone
- * @trip:      trip point to evaluate
- *
- * This function is responsible for checking if passed trip point is valid
- *
- * Return: true if trip point is valid, false otherwise
- */
-bool of_thermal_is_trip_valid(struct thermal_zone_device *tz, int trip)
-{
-       if (trip >= tz->num_trips || trip < 0)
-               return false;
-
-       return true;
-}
-EXPORT_SYMBOL_GPL(of_thermal_is_trip_valid);
-
 static int of_thermal_set_trip_hyst(struct thermal_zone_device *tz, int trip,
                                    int hyst)
 {