drm/atomic-helper: Fix spelling mistake "preceeding" -> "preceding"
[linux-block.git] / drivers / thermal / thermal_trip.c
index 53115cfdfd42a4318f52d648913c1043aa8d4c5c..024e2e365a26b60d8ef73c3bffa2053e90f818fb 100644 (file)
@@ -101,29 +101,11 @@ void __thermal_zone_set_trips(struct thermal_zone_device *tz)
 int __thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id,
                            struct thermal_trip *trip)
 {
-       int ret;
-
-       if (!tz || trip_id < 0 || trip_id >= tz->num_trips || !trip)
+       if (!tz || !tz->trips || trip_id < 0 || trip_id >= tz->num_trips || !trip)
                return -EINVAL;
 
-       if (tz->trips) {
-               *trip = tz->trips[trip_id];
-               return 0;
-       }
-
-       if (tz->ops->get_trip_hyst) {
-               ret = tz->ops->get_trip_hyst(tz, trip_id, &trip->hysteresis);
-               if (ret)
-                       return ret;
-       } else {
-               trip->hysteresis = 0;
-       }
-
-       ret = tz->ops->get_trip_temp(tz, trip_id, &trip->temperature);
-       if (ret)
-               return ret;
-
-       return tz->ops->get_trip_type(tz, trip_id, &trip->type);
+       *trip = tz->trips[trip_id];
+       return 0;
 }
 EXPORT_SYMBOL_GPL(__thermal_zone_get_trip);