]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/thermal/thermal_core.c
Merge tag 'for-5.4/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device...
[linux.git] / drivers / thermal / thermal_core.c
index bae1e412f57e121d67f3e85f941ec6391fee74f0..d4481cc8958fec35b5e6ca6fc1b4c677b8ca86a1 100644 (file)
@@ -304,7 +304,7 @@ static void thermal_zone_device_set_polling(struct thermal_zone_device *tz,
                                 &tz->poll_queue,
                                 msecs_to_jiffies(delay));
        else
-               cancel_delayed_work(&tz->poll_queue);
+               cancel_delayed_work_sync(&tz->poll_queue);
 }
 
 static void monitor_thermal_zone(struct thermal_zone_device *tz)
@@ -1245,17 +1245,26 @@ thermal_zone_device_register(const char *type, int trips, int mask,
        int count;
        struct thermal_governor *governor;
 
-       if (!type || strlen(type) == 0)
+       if (!type || strlen(type) == 0) {
+               pr_err("Error: No thermal zone type defined\n");
                return ERR_PTR(-EINVAL);
+       }
 
-       if (type && strlen(type) >= THERMAL_NAME_LENGTH)
+       if (type && strlen(type) >= THERMAL_NAME_LENGTH) {
+               pr_err("Error: Thermal zone name (%s) too long, should be under %d chars\n",
+                      type, THERMAL_NAME_LENGTH);
                return ERR_PTR(-EINVAL);
+       }
 
-       if (trips > THERMAL_MAX_TRIPS || trips < 0 || mask >> trips)
+       if (trips > THERMAL_MAX_TRIPS || trips < 0 || mask >> trips) {
+               pr_err("Error: Incorrect number of thermal trips\n");
                return ERR_PTR(-EINVAL);
+       }
 
-       if (!ops)
+       if (!ops) {
+               pr_err("Error: Thermal zone device ops not defined\n");
                return ERR_PTR(-EINVAL);
+       }
 
        if (trips > 0 && (!ops->get_trip_type || !ops->get_trip_temp))
                return ERR_PTR(-EINVAL);