OSDN Git Service

thermal/of: Remove of_thermal_get_crit_temp()
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Mon, 3 Oct 2022 09:25:52 +0000 (11:25 +0200)
committerDaniel Lezcano <daniel.lezcano@kernel.org>
Fri, 6 Jan 2023 13:14:47 +0000 (14:14 +0100)
The generic version of of_thermal_get_crit_temp() can be used. Let's
remove this ops which is pointless.

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

index 2fcdb3e..ff4d12e 100644 (file)
 
 #include "thermal_core.h"
 
-static int of_thermal_get_crit_temp(struct thermal_zone_device *tz,
-                                   int *temp)
-{
-       int i;
-
-       for (i = 0; i < tz->num_trips; i++)
-               if (tz->trips[i].type == THERMAL_TRIP_CRITICAL) {
-                       *temp = tz->trips[i].temperature;
-                       return 0;
-               }
-
-       return -EINVAL;
-}
-
 /***   functions parsing device tree nodes   ***/
 
 static int of_find_trip_id(struct device_node *np, struct device_node *trip)
@@ -531,7 +517,6 @@ struct thermal_zone_device *thermal_of_zone_register(struct device_node *sensor,
                goto out_kfree_trips;
        }
 
-       of_ops->get_crit_temp = of_ops->get_crit_temp ? : of_thermal_get_crit_temp;
        of_ops->bind = thermal_of_bind;
        of_ops->unbind = thermal_of_unbind;