]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
thermal: trip: Fold __thermal_zone_get_trip() into its caller
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 2 Jul 2024 14:44:27 +0000 (16:44 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 12 Jul 2024 13:14:56 +0000 (15:14 +0200)
Because __thermal_zone_get_trip() is only called by thermal_zone_get_trip()
now, fold the former into the latter.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/22339769.EfDdHjke4D@rjwysocki.net
drivers/thermal/thermal_trip.c
include/linux/thermal.h

index 2a876d3b93aa6b3ffd47678b8c45d2c7dbb88033..c0b679b846b3b90fd10738fd3c84226bb31f1f5a 100644 (file)
@@ -114,27 +114,17 @@ void thermal_zone_set_trips(struct thermal_zone_device *tz)
                dev_err(&tz->device, "Failed to set trips: %d\n", ret);
 }
 
-int __thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id,
-                           struct thermal_trip *trip)
-{
-       if (!tz || trip_id < 0 || trip_id >= tz->num_trips || !trip)
-               return -EINVAL;
-
-       *trip = tz->trips[trip_id].trip;
-       return 0;
-}
-EXPORT_SYMBOL_GPL(__thermal_zone_get_trip);
-
 int thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id,
                          struct thermal_trip *trip)
 {
-       int ret;
+       if (!tz || !trip || trip_id < 0 || trip_id >= tz->num_trips)
+               return -EINVAL;
 
        mutex_lock(&tz->lock);
-       ret = __thermal_zone_get_trip(tz, trip_id, trip);
+       *trip = tz->trips[trip_id].trip;
        mutex_unlock(&tz->lock);
 
-       return ret;
+       return 0;
 }
 EXPORT_SYMBOL_GPL(thermal_zone_get_trip);
 
index cdd9c722cda26586002a4ab94713d29a9294159c..25fbf960b474bd4d1aad8c14a544dc74c8df3b0a 100644 (file)
@@ -202,8 +202,6 @@ static inline void devm_thermal_of_zone_unregister(struct device *dev,
 }
 #endif
 
-int __thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id,
-                           struct thermal_trip *trip);
 int thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id,
                          struct thermal_trip *trip);
 int for_each_thermal_trip(struct thermal_zone_device *tz,