]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/acpi/device_pm.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux...
[karo-tx-linux.git] / drivers / acpi / device_pm.c
index 4cbc9505b365c354f230f0fe844bf259d8eb4484..dd314ef9bff144759154cb9e27eb8bc5ade63213 100644 (file)
@@ -330,6 +330,12 @@ int acpi_bus_init_power(struct acpi_device *device)
                result = acpi_dev_pm_explicit_set(device, state);
                if (result)
                        return result;
+       } else if (state == ACPI_STATE_UNKNOWN) {
+               /* No power resources and missing _PSC? Try to force D0. */
+               state = ACPI_STATE_D0;
+               result = acpi_dev_pm_explicit_set(device, state);
+               if (result)
+                       return result;
        }
        device->power.state = state;
        return 0;
@@ -349,6 +355,9 @@ int acpi_bus_update_power(acpi_handle handle, int *state_p)
        if (result)
                return result;
 
+       if (state == ACPI_STATE_UNKNOWN)
+               state = ACPI_STATE_D0;
+
        result = acpi_device_set_power(device, state);
        if (!result && state_p)
                *state_p = state;
@@ -497,7 +506,7 @@ int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p, int d_max_in)
        acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
        struct acpi_device *adev;
 
-       if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) {
+       if (!handle || acpi_bus_get_device(handle, &adev)) {
                dev_dbg(dev, "ACPI handle without context in %s!\n", __func__);
                return -ENODEV;
        }
@@ -574,7 +583,7 @@ int acpi_pm_device_run_wake(struct device *phys_dev, bool enable)
                return -EINVAL;
 
        handle = DEVICE_ACPI_HANDLE(phys_dev);
-       if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) {
+       if (!handle || acpi_bus_get_device(handle, &adev)) {
                dev_dbg(phys_dev, "ACPI handle without context in %s!\n",
                        __func__);
                return -ENODEV;
@@ -618,7 +627,7 @@ int acpi_pm_device_sleep_wake(struct device *dev, bool enable)
                return -EINVAL;
 
        handle = DEVICE_ACPI_HANDLE(dev);
-       if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) {
+       if (!handle || acpi_bus_get_device(handle, &adev)) {
                dev_dbg(dev, "ACPI handle without context in %s!\n", __func__);
                return -ENODEV;
        }