summaryrefslogtreecommitdiff
path: root/drivers/acpi/battery.c
diff options
context:
space:
mode:
authorLuis Henriques <luis.henriques@canonical.com>2015-05-12 00:48:38 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-05-14 01:58:39 +0300
commite234b074c8ebe736f74cc40a8953accb66b82d04 (patch)
tree8e118ea838e7707b1ecd64f75ae06ff2d502de11 /drivers/acpi/battery.c
parent030bbdbf4c833bc69f502eae58498bc5572db736 (diff)
downloadlinux-e234b074c8ebe736f74cc40a8953accb66b82d04.tar.xz
ACPI / battery: abort initialization earlier if acpi_disabled
If ACPI is disabled there's no need to schedule an async function call, the driver initialization can be aborted earlier in acpi_battery_init(). Signed-off-by: Luis Henriques <luis.henriques@canonical.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/battery.c')
-rw-r--r--drivers/acpi/battery.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 63d43677f644..69b8e607ec35 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -1292,9 +1292,6 @@ static struct acpi_driver acpi_battery_driver = {
static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie)
{
- if (acpi_disabled)
- return;
-
dmi_check_system(bat_dmi_table);
#ifdef CONFIG_ACPI_PROCFS_POWER
@@ -1313,6 +1310,9 @@ static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie)
static int __init acpi_battery_init(void)
{
+ if (acpi_disabled)
+ return -ENODEV;
+
async_schedule(acpi_battery_init_async, NULL);
return 0;
}