diff options
author | Luis Henriques <luis.henriques@canonical.com> | 2015-05-11 17:49:05 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-05-13 18:58:40 -0400 |
commit | eca21d9167213bc9217450613a671553ab45c225 (patch) | |
tree | 078a9760e7b71567dbe3e86cdfdccf6c179e7a6b | |
parent | 479faaf00fde35e80a5be1389938b38e422d799d (diff) |
ACPI / battery: ensure acpi_battery_init() has finish
Make sure that async function scheduled with async_schedule() has already
been executed.
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/acpi/battery.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 9c676a6f32ce..547e627611e0 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -70,6 +70,7 @@ MODULE_AUTHOR("Alexey Starikovskiy <astarikovskiy@suse.de>"); | |||
70 | MODULE_DESCRIPTION("ACPI Battery Driver"); | 70 | MODULE_DESCRIPTION("ACPI Battery Driver"); |
71 | MODULE_LICENSE("GPL"); | 71 | MODULE_LICENSE("GPL"); |
72 | 72 | ||
73 | static async_cookie_t async_cookie; | ||
73 | static int battery_bix_broken_package; | 74 | static int battery_bix_broken_package; |
74 | static int battery_notification_delay_ms; | 75 | static int battery_notification_delay_ms; |
75 | static unsigned int cache_time = 1000; | 76 | static unsigned int cache_time = 1000; |
@@ -1313,12 +1314,13 @@ static int __init acpi_battery_init(void) | |||
1313 | if (acpi_disabled) | 1314 | if (acpi_disabled) |
1314 | return -ENODEV; | 1315 | return -ENODEV; |
1315 | 1316 | ||
1316 | async_schedule(acpi_battery_init_async, NULL); | 1317 | async_cookie = async_schedule(acpi_battery_init_async, NULL); |
1317 | return 0; | 1318 | return 0; |
1318 | } | 1319 | } |
1319 | 1320 | ||
1320 | static void __exit acpi_battery_exit(void) | 1321 | static void __exit acpi_battery_exit(void) |
1321 | { | 1322 | { |
1323 | async_synchronize_cookie(async_cookie); | ||
1322 | acpi_bus_unregister_driver(&acpi_battery_driver); | 1324 | acpi_bus_unregister_driver(&acpi_battery_driver); |
1323 | #ifdef CONFIG_ACPI_PROCFS_POWER | 1325 | #ifdef CONFIG_ACPI_PROCFS_POWER |
1324 | acpi_unlock_battery_dir(acpi_battery_dir); | 1326 | acpi_unlock_battery_dir(acpi_battery_dir); |