Pull bugzilla-7570 into release branch

Len Brown cb2ebc59 3dfb7379

+7 -6
+7 -6
drivers/acpi/power.c
··· 436 436 cl = &device->power.states[device->power.state].resources; 437 437 tl = &device->power.states[state].resources; 438 438 439 - device->power.state = ACPI_STATE_UNKNOWN; 440 - 441 439 if (!cl->count && !tl->count) { 442 440 result = -ENODEV; 443 441 goto end; ··· 466 468 goto end; 467 469 } 468 470 469 - /* We shouldn't change the state till all above operations succeed */ 470 - device->power.state = state; 471 - end: 472 - if (result) 471 + end: 472 + if (result) { 473 + device->power.state = ACPI_STATE_UNKNOWN; 473 474 printk(KERN_WARNING PREFIX "Transitioning device [%s] to D%d\n", 474 475 device->pnp.bus_id, state); 476 + } else { 477 + /* We shouldn't change the state till all above operations succeed */ 478 + device->power.state = state; 479 + } 475 480 476 481 return result; 477 482 }