Merge branch 'spi' of git://gitorious.org/linus-tree/linus-tree into spi/next
[cascardo/linux.git] / drivers / acpi / scan.c
index 8ab80ba..767e2dc 100644 (file)
@@ -880,18 +880,22 @@ static int acpi_bus_get_power_flags(struct acpi_device *device)
                        int j;
 
                        device->power.flags.power_resources = 1;
-                       ps->flags.valid = 1;
                        for (j = 0; j < ps->resources.count; j++)
                                acpi_bus_add_power_resource(ps->resources.handles[j]);
                }
 
+               /* The exist of _PR3 indicates D3Cold support */
+               if (i == ACPI_STATE_D3) {
+                       status = acpi_get_handle(device->handle, object_name, &handle);
+                       if (ACPI_SUCCESS(status))
+                               device->power.states[ACPI_STATE_D3_COLD].flags.valid = 1;
+               }
+
                /* Evaluate "_PSx" to see if we can do explicit sets */
                object_name[2] = 'S';
                status = acpi_get_handle(device->handle, object_name, &handle);
-               if (ACPI_SUCCESS(status)) {
+               if (ACPI_SUCCESS(status))
                        ps->flags.explicit_set = 1;
-                       ps->flags.valid = 1;
-               }
 
                /* State is valid if we have some power control */
                if (ps->resources.count || ps->flags.explicit_set)