diff mbox

[RFC/RFT,3/3] ACPI / PM: Fix initial reference counting of power resources

Message ID 201010281511.07358.rjw@sisk.pl (mailing list archive)
State New, archived
Headers show

Commit Message

Rafael Wysocki Oct. 28, 2010, 1:11 p.m. UTC
None
diff mbox

Patch

Index: linux-2.6/drivers/acpi/scan.c
===================================================================
--- linux-2.6.orig/drivers/acpi/scan.c
+++ linux-2.6/drivers/acpi/scan.c
@@ -880,8 +880,10 @@  static int acpi_bus_get_power_flags(stru
 
 	/* TBD: System wake support and resource requirements. */
 
-	device->power.state = ACPI_STATE_UNKNOWN;
-	acpi_bus_get_power(device->handle, &(device->power.state));
+	acpi_bus_get_power(device->handle, &device->power.state);
+	/* Update power resources reference counting. */
+	if (device->power.flags.power_resources)
+		acpi_power_transition(device, device->power.state);
 
 	return 0;
 }