Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=653a00c9662304ef72a3eb4e681c91720960e0b4
Commit:     653a00c9662304ef72a3eb4e681c91720960e0b4
Parent:     cc0573b3250214034062ddf8c64359596d8af521
Author:     Zhang Rui <[EMAIL PROTECTED]>
AuthorDate: Thu Jan 17 15:51:18 2008 +0800
Committer:  Len Brown <[EMAIL PROTECTED]>
CommitDate: Fri Feb 1 23:21:03 2008 -0500

    ACPI: thermal fixup
    
    The alias name may be used in _PSL, _ALx and _TZD,
    so we bind the cooling device only if the acpi_device node matches.
    
    Signed-off-by: Zhang Rui <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Sujith <[EMAIL PROTECTED]>
    Signed-off-by: Len Brown <[EMAIL PROTECTED]>
---
 drivers/acpi/thermal.c |   42 ++++++++++++++++++++++++------------------
 1 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index aee371f..73f276b 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -1015,7 +1015,9 @@ static int acpi_thermal_cooling_device_cb(struct 
thermal_zone_device *thermal,
 {
        struct acpi_device *device = cdev->devdata;
        struct acpi_thermal *tz = thermal->devdata;
-       acpi_handle handle = device->handle;
+       struct acpi_device *dev;
+       acpi_status status;
+       acpi_handle handle;
        int i;
        int j;
        int trip = -1;
@@ -1031,12 +1033,13 @@ static int acpi_thermal_cooling_device_cb(struct 
thermal_zone_device *thermal,
                trip++;
                for (i = 0; i < tz->trips.passive.devices.count;
                    i++) {
-                       if (tz->trips.passive.devices.handles[i] !=
-                               handle)
-                               continue;
-                       result = action(thermal, trip, cdev);
-                       if (result)
-                               goto failed;
+                       handle = tz->trips.passive.devices.handles[i];
+                       status = acpi_bus_get_device(handle, &dev);
+                       if (ACPI_SUCCESS(status) && (dev == device)) {
+                               result = action(thermal, trip, cdev);
+                               if (result)
+                                       goto failed;
+                       }
                }
        }
 
@@ -1047,21 +1050,24 @@ static int acpi_thermal_cooling_device_cb(struct 
thermal_zone_device *thermal,
                for (j = 0;
                    j < tz->trips.active[i].devices.count;
                    j++) {
-                       if (tz->trips.active[i].devices.
-                                               handles[j] != handle)
-                               continue;
-                       result = action(thermal, trip, cdev);
-                       if (result)
-                               goto failed;
+                       handle = tz->trips.active[i].devices.handles[j];
+                       status = acpi_bus_get_device(handle, &dev);
+                       if (ACPI_SUCCESS(status) && (dev == device)) {
+                               result = action(thermal, trip, cdev);
+                               if (result)
+                                       goto failed;
+                       }
                }
        }
 
        for (i = 0; i < tz->devices.count; i++) {
-               if (tz->devices.handles[i] != handle)
-                       continue;
-               result = action(thermal, -1, cdev);
-               if (result)
-                       goto failed;
+               handle = tz->devices.handles[i];
+               status = acpi_bus_get_device(handle, &dev);
+               if (ACPI_SUCCESS(status) && (dev == device)) {
+                       result = action(thermal, -1, cdev);
+                       if (result)
+                               goto failed;
+               }
        }
 
 failed:
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to