Merge tag 'microblaze-v5.12' of git://git.monstr.eu/linux-2.6-microblaze
[linux-2.6-microblaze.git] / drivers / thermal / thermal_core.c
index bcc2ea4..996c038 100644 (file)
@@ -289,16 +289,11 @@ static int __init thermal_register_governors(void)
  * - Critical trip point will cause a system shutdown.
  */
 static void thermal_zone_device_set_polling(struct thermal_zone_device *tz,
-                                           int delay)
+                                           unsigned long delay)
 {
-       if (delay > 1000)
+       if (delay)
                mod_delayed_work(system_freezable_power_efficient_wq,
-                                &tz->poll_queue,
-                                round_jiffies(msecs_to_jiffies(delay)));
-       else if (delay)
-               mod_delayed_work(system_freezable_power_efficient_wq,
-                                &tz->poll_queue,
-                                msecs_to_jiffies(delay));
+                                &tz->poll_queue, delay);
        else
                cancel_delayed_work(&tz->poll_queue);
 }
@@ -317,9 +312,9 @@ static void monitor_thermal_zone(struct thermal_zone_device *tz)
        mutex_lock(&tz->lock);
 
        if (!stop && tz->passive)
-               thermal_zone_device_set_polling(tz, tz->passive_delay);
-       else if (!stop && tz->polling_delay)
-               thermal_zone_device_set_polling(tz, tz->polling_delay);
+               thermal_zone_device_set_polling(tz, tz->passive_delay_jiffies);
+       else if (!stop && tz->polling_delay_jiffies)
+               thermal_zone_device_set_polling(tz, tz->polling_delay_jiffies);
        else
                thermal_zone_device_set_polling(tz, 0);
 
@@ -483,12 +478,6 @@ static void thermal_zone_device_init(struct thermal_zone_device *tz)
                pos->initialized = false;
 }
 
-static void thermal_zone_device_reset(struct thermal_zone_device *tz)
-{
-       tz->passive = 0;
-       thermal_zone_device_init(tz);
-}
-
 static int thermal_zone_device_set_mode(struct thermal_zone_device *tz,
                                        enum thermal_device_mode mode)
 {
@@ -1312,8 +1301,9 @@ thermal_zone_device_register(const char *type, int trips, int mask,
        tz->device.class = &thermal_class;
        tz->devdata = devdata;
        tz->trips = trips;
-       tz->passive_delay = passive_delay;
-       tz->polling_delay = polling_delay;
+
+       thermal_set_delay_jiffies(&tz->passive_delay_jiffies, passive_delay);
+       thermal_set_delay_jiffies(&tz->polling_delay_jiffies, polling_delay);
 
        /* sys I/F */
        /* Add nodes that are always present via .groups */
@@ -1367,7 +1357,7 @@ thermal_zone_device_register(const char *type, int trips, int mask,
 
        INIT_DELAYED_WORK(&tz->poll_queue, thermal_zone_device_check);
 
-       thermal_zone_device_reset(tz);
+       thermal_zone_device_init(tz);
        /* Update the new thermal zone and mark it as already updated. */
        if (atomic_cmpxchg(&tz->need_update, 1, 0))
                thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED);