diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2010-11-24 18:10:02 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-01-12 04:48:45 -0500 |
commit | 97d9a9e9f5ee68f20005ca5aa77c6b684e7cace8 (patch) | |
tree | 37961b9dd711862f0b181bb6890f47fba3f58345 /drivers/acpi/scan.c | |
parent | 25eed40720fc9005c63a1f436e5f8a78836c26ff (diff) |
ACPI / PM: Register acpi_power_driver early
The ACPI device driver used for handling power resources,
acpi_power_driver, creates a struct acpi_power_resource object for
each ACPI device representing a power resource. These objects are
then used when setting and reading the power states of devices using
the corresponding power resources. Unfortunately, acpi_power_driver
is registered after acpi_scan_init() that may add devices using the
power resources before acpi_power_driver has a chance to create
struct acpi_power_resource objects for them (specifically, the power
resources may be referred to during the scanning process through
acpi_bus_get_power() before they have been initialized).
As the first step towards fixing this issue, move the registration
of acpi_power_driver into acpi_scan_init() so that power resource
devices can be initialized by it as soon as they have been found in
the namespace.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r-- | drivers/acpi/scan.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index ef8e659771e1..2951a27303cb 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -1570,6 +1570,8 @@ int __init acpi_scan_init(void) | |||
1570 | printk(KERN_ERR PREFIX "Could not register bus type\n"); | 1570 | printk(KERN_ERR PREFIX "Could not register bus type\n"); |
1571 | } | 1571 | } |
1572 | 1572 | ||
1573 | acpi_power_init(); | ||
1574 | |||
1573 | /* | 1575 | /* |
1574 | * Enumerate devices in the ACPI namespace. | 1576 | * Enumerate devices in the ACPI namespace. |
1575 | */ | 1577 | */ |