Merge tag 'hwlock-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson...
[linux-2.6-microblaze.git] / drivers / thermal / thermal_of.c
index ddf88db..69ef12f 100644 (file)
@@ -51,7 +51,6 @@ struct __thermal_bind_params {
 
 /**
  * struct __thermal_zone - internal representation of a thermal zone
- * @mode: current thermal zone device mode (enabled/disabled)
  * @passive_delay: polling interval while passive cooling is activated
  * @polling_delay: zone polling interval
  * @slope: slope of the temperature adjustment curve
@@ -65,7 +64,6 @@ struct __thermal_bind_params {
  */
 
 struct __thermal_zone {
-       enum thermal_device_mode mode;
        int passive_delay;
        int polling_delay;
        int slope;
@@ -269,39 +267,6 @@ static int of_thermal_unbind(struct thermal_zone_device *thermal,
        return 0;
 }
 
-static int of_thermal_get_mode(struct thermal_zone_device *tz,
-                              enum thermal_device_mode *mode)
-{
-       struct __thermal_zone *data = tz->devdata;
-
-       *mode = data->mode;
-
-       return 0;
-}
-
-static int of_thermal_set_mode(struct thermal_zone_device *tz,
-                              enum thermal_device_mode mode)
-{
-       struct __thermal_zone *data = tz->devdata;
-
-       mutex_lock(&tz->lock);
-
-       if (mode == THERMAL_DEVICE_ENABLED) {
-               tz->polling_delay = data->polling_delay;
-               tz->passive_delay = data->passive_delay;
-       } else {
-               tz->polling_delay = 0;
-               tz->passive_delay = 0;
-       }
-
-       mutex_unlock(&tz->lock);
-
-       data->mode = mode;
-       thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED);
-
-       return 0;
-}
-
 static int of_thermal_get_trip_type(struct thermal_zone_device *tz, int trip,
                                    enum thermal_trip_type *type)
 {
@@ -393,9 +358,6 @@ static int of_thermal_get_crit_temp(struct thermal_zone_device *tz,
 }
 
 static struct thermal_zone_device_ops of_thermal_ops = {
-       .get_mode = of_thermal_get_mode,
-       .set_mode = of_thermal_set_mode,
-
        .get_trip_type = of_thermal_get_trip_type,
        .get_trip_temp = of_thermal_get_trip_temp,
        .set_trip_temp = of_thermal_set_trip_temp,
@@ -554,7 +516,7 @@ thermal_zone_of_sensor_register(struct device *dev, int sensor_id, void *data,
                        tzd = thermal_zone_of_add_sensor(child, sensor_np,
                                                         data, ops);
                        if (!IS_ERR(tzd))
-                               tzd->ops->set_mode(tzd, THERMAL_DEVICE_ENABLED);
+                               thermal_zone_device_enable(tzd);
 
                        of_node_put(child);
                        goto exit;
@@ -979,7 +941,6 @@ __init *thermal_of_build_thermal_zone(struct device_node *np)
 
 finish:
        of_node_put(child);
-       tz->mode = THERMAL_DEVICE_DISABLED;
 
        return tz;