aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/power.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/power.c')
-rw-r--r--drivers/acpi/power.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 56665a63bf19..d74365d4a6e7 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -194,7 +194,7 @@ static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state)
194 194
195static int acpi_power_on(acpi_handle handle, struct acpi_device *dev) 195static int acpi_power_on(acpi_handle handle, struct acpi_device *dev)
196{ 196{
197 int result = 0, state; 197 int result = 0;
198 int found = 0; 198 int found = 0;
199 acpi_status status = AE_OK; 199 acpi_status status = AE_OK;
200 struct acpi_power_resource *resource = NULL; 200 struct acpi_power_resource *resource = NULL;
@@ -236,18 +236,6 @@ static int acpi_power_on(acpi_handle handle, struct acpi_device *dev)
236 if (ACPI_FAILURE(status)) 236 if (ACPI_FAILURE(status))
237 return -ENODEV; 237 return -ENODEV;
238 238
239 if (!acpi_power_nocheck) {
240 /*
241 * If acpi_power_nocheck is set, it is unnecessary to check
242 * the power state after power transition.
243 */
244 result = acpi_power_get_state(resource->device->handle,
245 &state);
246 if (result)
247 return result;
248 if (state != ACPI_POWER_RESOURCE_STATE_ON)
249 return -ENOEXEC;
250 }
251 /* Update the power resource's _device_ power state */ 239 /* Update the power resource's _device_ power state */
252 resource->device->power.state = ACPI_STATE_D0; 240 resource->device->power.state = ACPI_STATE_D0;
253 241
@@ -258,7 +246,7 @@ static int acpi_power_on(acpi_handle handle, struct acpi_device *dev)
258 246
259static int acpi_power_off_device(acpi_handle handle, struct acpi_device *dev) 247static int acpi_power_off_device(acpi_handle handle, struct acpi_device *dev)
260{ 248{
261 int result = 0, state; 249 int result = 0;
262 acpi_status status = AE_OK; 250 acpi_status status = AE_OK;
263 struct acpi_power_resource *resource = NULL; 251 struct acpi_power_resource *resource = NULL;
264 struct list_head *node, *next; 252 struct list_head *node, *next;
@@ -293,18 +281,6 @@ static int acpi_power_off_device(acpi_handle handle, struct acpi_device *dev)
293 if (ACPI_FAILURE(status)) 281 if (ACPI_FAILURE(status))
294 return -ENODEV; 282 return -ENODEV;
295 283
296 if (!acpi_power_nocheck) {
297 /*
298 * If acpi_power_nocheck is set, it is unnecessary to check
299 * the power state after power transition.
300 */
301 result = acpi_power_get_state(handle, &state);
302 if (result)
303 return result;
304 if (state != ACPI_POWER_RESOURCE_STATE_OFF)
305 return -ENOEXEC;
306 }
307
308 /* Update the power resource's _device_ power state */ 284 /* Update the power resource's _device_ power state */
309 resource->device->power.state = ACPI_STATE_D3; 285 resource->device->power.state = ACPI_STATE_D3;
310 286