]> err.no Git - linux-2.6/blobdiff - drivers/acpi/thermal.c
[PATCH] Add driver for ARM AMBA PL031 RTC
[linux-2.6] / drivers / acpi / thermal.c
index 82389b1781300ccd606916600f839b9544010b9b..e7fe3a14fdafd46e88851f348657835555e7e484 100644 (file)
@@ -82,6 +82,7 @@ MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.\n");
 
 static int acpi_thermal_add(struct acpi_device *device);
 static int acpi_thermal_remove(struct acpi_device *device, int type);
+static int acpi_thermal_resume(struct acpi_device *device, int state);
 static int acpi_thermal_state_open_fs(struct inode *inode, struct file *file);
 static int acpi_thermal_temp_open_fs(struct inode *inode, struct file *file);
 static int acpi_thermal_trip_open_fs(struct inode *inode, struct file *file);
@@ -103,6 +104,7 @@ static struct acpi_driver acpi_thermal_driver = {
        .ops = {
                .add = acpi_thermal_add,
                .remove = acpi_thermal_remove,
+               .resume = acpi_thermal_resume,
                },
 };
 
@@ -684,8 +686,7 @@ static void acpi_thermal_run(unsigned long data)
 {
        struct acpi_thermal *tz = (struct acpi_thermal *)data;
        if (!tz->zombie)
-               acpi_os_queue_for_execution(OSD_PRIORITY_GPE,
-                                           acpi_thermal_check, (void *)data);
+               acpi_os_execute(OSL_GPE_HANDLER, acpi_thermal_check, (void *)data);
 }
 
 static void acpi_thermal_check(void *data)
@@ -942,8 +943,10 @@ acpi_thermal_write_trip_points(struct file *file,
        memset(limit_string, 0, ACPI_THERMAL_MAX_LIMIT_STR_LEN);
 
        active = kmalloc(ACPI_THERMAL_MAX_ACTIVE * sizeof(int), GFP_KERNEL);
-       if (!active)
+       if (!active) {
+               kfree(limit_string);
                return_VALUE(-ENOMEM);
+       }
 
        if (!tz || (count > ACPI_THERMAL_MAX_LIMIT_STR_LEN - 1)) {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n"));
@@ -1416,6 +1419,20 @@ static int acpi_thermal_remove(struct acpi_device *device, int type)
        return_VALUE(0);
 }
 
+static int acpi_thermal_resume(struct acpi_device *device, int state)
+{
+       struct acpi_thermal *tz = NULL;
+
+       if (!device || !acpi_driver_data(device))
+               return_VALUE(-EINVAL);
+
+       tz = (struct acpi_thermal *)acpi_driver_data(device);
+
+       acpi_thermal_check(tz);
+
+       return AE_OK;
+}
+
 static int __init acpi_thermal_init(void)
 {
        int result = 0;