Skip to content

Commit 91b3aaf

Browse files
groeckrafaeljw
authored andcommitted
thermal/core: Remove thermal_zone_set_trips()
Since no callers of thermal_zone_set_trips() are left, remove the function. Document __thermal_zone_set_trips() instead. Explicitly state that the thermal zone lock must be held when calling the function, and that the pointer to the thermal zone must be valid. Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 05eeee2 commit 91b3aaf

File tree

2 files changed

+15
-20
lines changed

2 files changed

+15
-20
lines changed

drivers/thermal/thermal_core.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ void __thermal_zone_device_update(struct thermal_zone_device *tz,
113113
enum thermal_notify_event event);
114114

115115
/* Helpers */
116-
void thermal_zone_set_trips(struct thermal_zone_device *tz);
117116
void __thermal_zone_set_trips(struct thermal_zone_device *tz);
118117
int __thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp);
119118

drivers/thermal/thermal_helpers.c

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,21 @@ int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp)
147147
}
148148
EXPORT_SYMBOL_GPL(thermal_zone_get_temp);
149149

150+
/**
151+
* __thermal_zone_set_trips - Computes the next trip points for the driver
152+
* @tz: a pointer to a thermal zone device structure
153+
*
154+
* The function computes the next temperature boundaries by browsing
155+
* the trip points. The result is the closer low and high trip points
156+
* to the current temperature. These values are passed to the backend
157+
* driver to let it set its own notification mechanism (usually an
158+
* interrupt).
159+
*
160+
* This function must be called with tz->lock held. Both tz and tz->ops
161+
* must be valid pointers.
162+
*
163+
* It does not return a value
164+
*/
150165
void __thermal_zone_set_trips(struct thermal_zone_device *tz)
151166
{
152167
int low = -INT_MAX;
@@ -193,25 +208,6 @@ void __thermal_zone_set_trips(struct thermal_zone_device *tz)
193208
dev_err(&tz->device, "Failed to set trips: %d\n", ret);
194209
}
195210

196-
/**
197-
* thermal_zone_set_trips - Computes the next trip points for the driver
198-
* @tz: a pointer to a thermal zone device structure
199-
*
200-
* The function computes the next temperature boundaries by browsing
201-
* the trip points. The result is the closer low and high trip points
202-
* to the current temperature. These values are passed to the backend
203-
* driver to let it set its own notification mechanism (usually an
204-
* interrupt).
205-
*
206-
* It does not return a value
207-
*/
208-
void thermal_zone_set_trips(struct thermal_zone_device *tz)
209-
{
210-
mutex_lock(&tz->lock);
211-
__thermal_zone_set_trips(tz);
212-
mutex_unlock(&tz->lock);
213-
}
214-
215211
static void thermal_cdev_set_cur_state(struct thermal_cooling_device *cdev,
216212
int target)
217213
{

0 commit comments

Comments
 (0)