aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/power.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-17 08:11:06 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-17 08:11:06 -0500
commit722c929f32616943d2b67332068f09c08e81eec8 (patch)
tree7554d567de4b293c691797853968515d2f7d07ef /drivers/acpi/power.c
parent781d737c7466845035e5ce02885c7436b5278b90 (diff)
ACPI: Do not use device power states of power resources
ACPI power resource objects have struct acpi_device components, but they are only used for registering those resources in the device hierarchy. In particular, power state information stored in them is completely useless (amnong other things, because the power resources "devices" are not power manageable), so there is no reason for the power resources management code to keep it up to date. Remove the code updating device power states of power resources from drivers/acpi/power.c. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/power.c')
-rw-r--r--drivers/acpi/power.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 29803857a2ef..06ad05288af8 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -193,9 +193,6 @@ static int __acpi_power_on(struct acpi_power_resource *resource)
193 if (ACPI_FAILURE(status)) 193 if (ACPI_FAILURE(status))
194 return -ENODEV; 194 return -ENODEV;
195 195
196 /* Update the power resource's _device_ power state */
197 resource->device.power.state = ACPI_STATE_D0;
198
199 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Power resource [%s] turned on\n", 196 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Power resource [%s] turned on\n",
200 resource->name)); 197 resource->name));
201 198
@@ -261,16 +258,12 @@ static int acpi_power_off(acpi_handle handle)
261 } 258 }
262 259
263 status = acpi_evaluate_object(resource->device.handle, "_OFF", NULL, NULL); 260 status = acpi_evaluate_object(resource->device.handle, "_OFF", NULL, NULL);
264 if (ACPI_FAILURE(status)) { 261 if (ACPI_FAILURE(status))
265 result = -ENODEV; 262 result = -ENODEV;
266 } else { 263 else
267 /* Update the power resource's _device_ power state */
268 resource->device.power.state = ACPI_STATE_D3;
269
270 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 264 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
271 "Power resource [%s] turned off\n", 265 "Power resource [%s] turned off\n",
272 resource->name)); 266 resource->name));
273 }
274 267
275 unlock: 268 unlock:
276 mutex_unlock(&resource->resource_lock); 269 mutex_unlock(&resource->resource_lock);
@@ -659,6 +652,7 @@ void acpi_add_power_resource(acpi_handle handle)
659 resource->name = device->pnp.bus_id; 652 resource->name = device->pnp.bus_id;
660 strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME); 653 strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME);
661 strcpy(acpi_device_class(device), ACPI_POWER_CLASS); 654 strcpy(acpi_device_class(device), ACPI_POWER_CLASS);
655 device->power.state = ACPI_STATE_UNKNOWN;
662 656
663 /* Evalute the object to get the system level and resource order. */ 657 /* Evalute the object to get the system level and resource order. */
664 status = acpi_evaluate_object(handle, NULL, NULL, &buffer); 658 status = acpi_evaluate_object(handle, NULL, NULL, &buffer);
@@ -672,17 +666,6 @@ void acpi_add_power_resource(acpi_handle handle)
672 if (result) 666 if (result)
673 goto err; 667 goto err;
674 668
675 switch (state) {
676 case ACPI_POWER_RESOURCE_STATE_ON:
677 device->power.state = ACPI_STATE_D0;
678 break;
679 case ACPI_POWER_RESOURCE_STATE_OFF:
680 device->power.state = ACPI_STATE_D3;
681 break;
682 default:
683 device->power.state = ACPI_STATE_UNKNOWN;
684 }
685
686 printk(KERN_INFO PREFIX "%s [%s] (%s)\n", acpi_device_name(device), 669 printk(KERN_INFO PREFIX "%s [%s] (%s)\n", acpi_device_name(device),
687 acpi_device_bid(device), state ? "on" : "off"); 670 acpi_device_bid(device), state ? "on" : "off");
688 671