Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350916
b: refs/heads/master
c: 722c929
h: refs/heads/master
v: v3
  • Loading branch information
Rafael J. Wysocki committed Jan 17, 2013
1 parent 509f4a4 commit 748f64c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 781d737c7466845035e5ce02885c7436b5278b90
refs/heads/master: 722c929f32616943d2b67332068f09c08e81eec8
23 changes: 3 additions & 20 deletions trunk/drivers/acpi/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,6 @@ static int __acpi_power_on(struct acpi_power_resource *resource)
if (ACPI_FAILURE(status))
return -ENODEV;

/* Update the power resource's _device_ power state */
resource->device.power.state = ACPI_STATE_D0;

ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Power resource [%s] turned on\n",
resource->name));

Expand Down Expand Up @@ -261,16 +258,12 @@ static int acpi_power_off(acpi_handle handle)
}

status = acpi_evaluate_object(resource->device.handle, "_OFF", NULL, NULL);
if (ACPI_FAILURE(status)) {
if (ACPI_FAILURE(status))
result = -ENODEV;
} else {
/* Update the power resource's _device_ power state */
resource->device.power.state = ACPI_STATE_D3;

else
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Power resource [%s] turned off\n",
resource->name));
}

unlock:
mutex_unlock(&resource->resource_lock);
Expand Down Expand Up @@ -659,6 +652,7 @@ void acpi_add_power_resource(acpi_handle handle)
resource->name = device->pnp.bus_id;
strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME);
strcpy(acpi_device_class(device), ACPI_POWER_CLASS);
device->power.state = ACPI_STATE_UNKNOWN;

/* Evalute the object to get the system level and resource order. */
status = acpi_evaluate_object(handle, NULL, NULL, &buffer);
Expand All @@ -672,17 +666,6 @@ void acpi_add_power_resource(acpi_handle handle)
if (result)
goto err;

switch (state) {
case ACPI_POWER_RESOURCE_STATE_ON:
device->power.state = ACPI_STATE_D0;
break;
case ACPI_POWER_RESOURCE_STATE_OFF:
device->power.state = ACPI_STATE_D3;
break;
default:
device->power.state = ACPI_STATE_UNKNOWN;
}

printk(KERN_INFO PREFIX "%s [%s] (%s)\n", acpi_device_name(device),
acpi_device_bid(device), state ? "on" : "off");

Expand Down

0 comments on commit 748f64c

Please sign in to comment.