diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index b130ea0d0759a3f95c8b81d3c203e4bdea1c5820..298caf6862b6de6eee9f210d3810ab6da3cdda4d 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -37,7 +37,6 @@ obj-y += scan.o # Keep EC driver first. Initialization of others depend on it. obj-y += ec.o obj-$(CONFIG_ACPI_AC) += ac.o -obj-$(CONFIG_ACPI_BATTERY) += battery.o obj-$(CONFIG_ACPI_BUTTON) += button.o obj-$(CONFIG_ACPI_FAN) += fan.o obj-$(CONFIG_ACPI_DOCK) += dock.o @@ -57,5 +56,6 @@ obj-$(CONFIG_ACPI_DEBUG) += debug.o obj-$(CONFIG_ACPI_NUMA) += numa.o obj-$(CONFIG_ACPI_HOTPLUG_MEMORY) += acpi_memhotplug.o obj-$(CONFIG_ACPI_PROCFS_POWER) += cm_sbs.o +obj-$(CONFIG_ACPI_BATTERY) += battery.o obj-$(CONFIG_ACPI_SBS) += sbshc.o obj-$(CONFIG_ACPI_SBS) += sbs.o diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 69cbc57c2d1cd248e7431bb40661e9ea139efbb7..0f1c8190c1d31ac90af7ce810795794214d44ab4 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -30,6 +30,7 @@ #include #include #include +#include #ifdef CONFIG_ACPI_PROCFS_POWER #include @@ -901,21 +902,27 @@ static struct acpi_driver acpi_battery_driver = { }, }; -static int __init acpi_battery_init(void) +static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie) { if (acpi_disabled) - return -ENODEV; + return; #ifdef CONFIG_ACPI_PROCFS_POWER acpi_battery_dir = acpi_lock_battery_dir(); if (!acpi_battery_dir) - return -ENODEV; + return; #endif if (acpi_bus_register_driver(&acpi_battery_driver) < 0) { #ifdef CONFIG_ACPI_PROCFS_POWER acpi_unlock_battery_dir(acpi_battery_dir); #endif - return -ENODEV; + return; } + return; +} + +static int __init acpi_battery_init(void) +{ + async_schedule(acpi_battery_init_async, NULL); return 0; }