]> Pileus Git - ~andy/linux/blobdiff - drivers/thermal/thermal_sys.c
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux...
[~andy/linux] / drivers / thermal / thermal_sys.c
index 47498b8719032668f02c08c235614f0e55464ade..9ee42ca4d289754cb99b374a32eb8bdc59371e46 100644 (file)
@@ -88,7 +88,7 @@ again:
        else if (unlikely(err))
                return err;
 
-       *id = *id & MAX_ID_MASK;
+       *id = *id & MAX_IDR_MASK;
        return 0;
 }
 
@@ -703,17 +703,14 @@ thermal_remove_hwmon_sysfs(struct thermal_zone_device *tz)
 static void thermal_zone_device_set_polling(struct thermal_zone_device *tz,
                                            int delay)
 {
-       cancel_delayed_work(&(tz->poll_queue));
-
-       if (!delay)
-               return;
-
        if (delay > 1000)
-               queue_delayed_work(system_freezable_wq, &(tz->poll_queue),
-                                     round_jiffies(msecs_to_jiffies(delay)));
+               mod_delayed_work(system_freezable_wq, &tz->poll_queue,
+                                round_jiffies(msecs_to_jiffies(delay)));
+       else if (delay)
+               mod_delayed_work(system_freezable_wq, &tz->poll_queue,
+                                msecs_to_jiffies(delay));
        else
-               queue_delayed_work(system_freezable_wq, &(tz->poll_queue),
-                                     msecs_to_jiffies(delay));
+               cancel_delayed_work(&tz->poll_queue);
 }
 
 static void thermal_zone_device_check(struct work_struct *work)