diff options
Diffstat (limited to 'drivers/acpi/battery.c')
-rw-r--r-- | drivers/acpi/battery.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 69cbc57c2d1c..0f1c8190c1d3 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/init.h> | 30 | #include <linux/init.h> |
31 | #include <linux/types.h> | 31 | #include <linux/types.h> |
32 | #include <linux/jiffies.h> | 32 | #include <linux/jiffies.h> |
33 | #include <linux/async.h> | ||
33 | 34 | ||
34 | #ifdef CONFIG_ACPI_PROCFS_POWER | 35 | #ifdef CONFIG_ACPI_PROCFS_POWER |
35 | #include <linux/proc_fs.h> | 36 | #include <linux/proc_fs.h> |
@@ -901,21 +902,27 @@ static struct acpi_driver acpi_battery_driver = { | |||
901 | }, | 902 | }, |
902 | }; | 903 | }; |
903 | 904 | ||
904 | static int __init acpi_battery_init(void) | 905 | static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie) |
905 | { | 906 | { |
906 | if (acpi_disabled) | 907 | if (acpi_disabled) |
907 | return -ENODEV; | 908 | return; |
908 | #ifdef CONFIG_ACPI_PROCFS_POWER | 909 | #ifdef CONFIG_ACPI_PROCFS_POWER |
909 | acpi_battery_dir = acpi_lock_battery_dir(); | 910 | acpi_battery_dir = acpi_lock_battery_dir(); |
910 | if (!acpi_battery_dir) | 911 | if (!acpi_battery_dir) |
911 | return -ENODEV; | 912 | return; |
912 | #endif | 913 | #endif |
913 | if (acpi_bus_register_driver(&acpi_battery_driver) < 0) { | 914 | if (acpi_bus_register_driver(&acpi_battery_driver) < 0) { |
914 | #ifdef CONFIG_ACPI_PROCFS_POWER | 915 | #ifdef CONFIG_ACPI_PROCFS_POWER |
915 | acpi_unlock_battery_dir(acpi_battery_dir); | 916 | acpi_unlock_battery_dir(acpi_battery_dir); |
916 | #endif | 917 | #endif |
917 | return -ENODEV; | 918 | return; |
918 | } | 919 | } |
920 | return; | ||
921 | } | ||
922 | |||
923 | static int __init acpi_battery_init(void) | ||
924 | { | ||
925 | async_schedule(acpi_battery_init_async, NULL); | ||
919 | return 0; | 926 | return 0; |
920 | } | 927 | } |
921 | 928 | ||