|
@@ -286,30 +286,6 @@ static void thermal_unregister_governors(void)
|
|
thermal_gov_power_allocator_unregister();
|
|
thermal_gov_power_allocator_unregister();
|
|
}
|
|
}
|
|
|
|
|
|
-static int get_idr(struct idr *idr, struct mutex *lock, int *id)
|
|
|
|
-{
|
|
|
|
- int ret;
|
|
|
|
-
|
|
|
|
- if (lock)
|
|
|
|
- mutex_lock(lock);
|
|
|
|
- ret = idr_alloc(idr, NULL, 0, 0, GFP_KERNEL);
|
|
|
|
- if (lock)
|
|
|
|
- mutex_unlock(lock);
|
|
|
|
- if (unlikely(ret < 0))
|
|
|
|
- return ret;
|
|
|
|
- *id = ret;
|
|
|
|
- return 0;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static void release_idr(struct idr *idr, struct mutex *lock, int id)
|
|
|
|
-{
|
|
|
|
- if (lock)
|
|
|
|
- mutex_lock(lock);
|
|
|
|
- idr_remove(idr, id);
|
|
|
|
- if (lock)
|
|
|
|
- mutex_unlock(lock);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static void print_bind_err_msg(struct thermal_zone_device *tz,
|
|
static void print_bind_err_msg(struct thermal_zone_device *tz,
|
|
struct thermal_cooling_device *cdev, int ret)
|
|
struct thermal_cooling_device *cdev, int ret)
|
|
{
|
|
{
|
|
@@ -699,6 +675,30 @@ void thermal_zone_device_unbind_exception(struct thermal_zone_device *tz,
|
|
|
|
|
|
/* Device management */
|
|
/* Device management */
|
|
|
|
|
|
|
|
+static int get_idr(struct idr *idr, struct mutex *lock, int *id)
|
|
|
|
+{
|
|
|
|
+ int ret;
|
|
|
|
+
|
|
|
|
+ if (lock)
|
|
|
|
+ mutex_lock(lock);
|
|
|
|
+ ret = idr_alloc(idr, NULL, 0, 0, GFP_KERNEL);
|
|
|
|
+ if (lock)
|
|
|
|
+ mutex_unlock(lock);
|
|
|
|
+ if (unlikely(ret < 0))
|
|
|
|
+ return ret;
|
|
|
|
+ *id = ret;
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void release_idr(struct idr *idr, struct mutex *lock, int id)
|
|
|
|
+{
|
|
|
|
+ if (lock)
|
|
|
|
+ mutex_lock(lock);
|
|
|
|
+ idr_remove(idr, id);
|
|
|
|
+ if (lock)
|
|
|
|
+ mutex_unlock(lock);
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* thermal_zone_bind_cooling_device() - bind a cooling device to a thermal zone
|
|
* thermal_zone_bind_cooling_device() - bind a cooling device to a thermal zone
|
|
* @tz: pointer to struct thermal_zone_device
|
|
* @tz: pointer to struct thermal_zone_device
|