]> err.no Git - linux-2.6/blobdiff - drivers/acpi/thermal.c
[POWERPC] spufs: lockdep annotations for spufs_dir_close
[linux-2.6] / drivers / acpi / thermal.c
index 8d4b79b4f933c631281e23ce8b602e3bcbbf3d9f..766bd25d3376ac35f326c72ae9909777bb839004 100644 (file)
@@ -879,6 +879,8 @@ static void acpi_thermal_check(void *data)
 }
 
 /* sys I/F for generic thermal sysfs support */
+#define KELVIN_TO_MILLICELSIUS(t) (t * 100 - 273200)
+
 static int thermal_get_temp(struct thermal_zone_device *thermal, char *buf)
 {
        struct acpi_thermal *tz = thermal->devdata;
@@ -886,7 +888,7 @@ static int thermal_get_temp(struct thermal_zone_device *thermal, char *buf)
        if (!tz)
                return -EINVAL;
 
-       return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(tz->temperature));
+       return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(tz->temperature));
 }
 
 static const char enabled[] = "kernel";
@@ -980,21 +982,21 @@ static int thermal_get_trip_temp(struct thermal_zone_device *thermal,
 
        if (tz->trips.critical.flags.valid) {
                if (!trip)
-                       return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+                       return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
                                tz->trips.critical.temperature));
                trip--;
        }
 
        if (tz->trips.hot.flags.valid) {
                if (!trip)
-                       return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+                       return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
                                        tz->trips.hot.temperature));
                trip--;
        }
 
        if (tz->trips.passive.flags.valid) {
                if (!trip)
-                       return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+                       return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
                                        tz->trips.passive.temperature));
                trip--;
        }
@@ -1002,7 +1004,7 @@ static int thermal_get_trip_temp(struct thermal_zone_device *thermal,
        for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE &&
                tz->trips.active[i].flags.valid; i++) {
                if (!trip)
-                       return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
+                       return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
                                        tz->trips.active[i].temperature));
                trip--;
        }
@@ -1123,7 +1125,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
                        tz->trips.active[i].flags.valid; i++, trips++);
        tz->thermal_zone = thermal_zone_device_register("ACPI thermal zone",
                                        trips, tz, &acpi_thermal_zone_ops);
-       if (!tz->thermal_zone)
+       if (IS_ERR(tz->thermal_zone))
                return -ENODEV;
 
        result = sysfs_create_link(&tz->device->dev.kobj,
@@ -1708,7 +1710,6 @@ static int acpi_thermal_resume(struct acpi_device *device)
        return AE_OK;
 }
 
-#ifdef CONFIG_DMI
 static int thermal_act(const struct dmi_system_id *d) {
 
        if (act == 0) {
@@ -1783,7 +1784,6 @@ static struct dmi_system_id thermal_dmi_table[] __initdata = {
        },
        {}
 };
-#endif /* CONFIG_DMI */
 
 static int __init acpi_thermal_init(void)
 {