Pull bugzilla-7570 into release branch

Len Brown cb2ebc59 3dfb7379

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