Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 5b674ba

Browse files
committed
thermal: trip: Fold __thermal_zone_get_trip() into its caller
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
1 parent 0728c81 commit 5b674ba

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

drivers/thermal/thermal_trip.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -114,27 +114,17 @@ void thermal_zone_set_trips(struct thermal_zone_device *tz)
114114
dev_err(&tz->device, "Failed to set trips: %d\n", ret);
115115
}
116116

117-
int __thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id,
118-
struct thermal_trip *trip)
119-
{
120-
if (!tz || trip_id < 0 || trip_id >= tz->num_trips || !trip)
121-
return -EINVAL;
122-
123-
*trip = tz->trips[trip_id].trip;
124-
return 0;
125-
}
126-
EXPORT_SYMBOL_GPL(__thermal_zone_get_trip);
127-
128117
int thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id,
129118
struct thermal_trip *trip)
130119
{
131-
int ret;
120+
if (!tz || !trip || trip_id < 0 || trip_id >= tz->num_trips)
121+
return -EINVAL;
132122

133123
mutex_lock(&tz->lock);
134-
ret = __thermal_zone_get_trip(tz, trip_id, trip);
124+
*trip = tz->trips[trip_id].trip;
135125
mutex_unlock(&tz->lock);
136126

137-
return ret;
127+
return 0;
138128
}
139129
EXPORT_SYMBOL_GPL(thermal_zone_get_trip);
140130

include/linux/thermal.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,6 @@ static inline void devm_thermal_of_zone_unregister(struct device *dev,
202202
}
203203
#endif
204204

205-
int __thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id,
206-
struct thermal_trip *trip);
207205
int thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id,
208206
struct thermal_trip *trip);
209207
int for_each_thermal_trip(struct thermal_zone_device *tz,

0 commit comments

Comments
 (0)