lkml.org 
[lkml]   [2015]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] ACPI / battery: abort initialization earlier if acpi_disabled
Date
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>
---
drivers/acpi/battery.c | 6 +++---
1 file 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;
}

\
 
 \ /
  Last update: 2015-05-12 00:21    [W:0.021 / U:24.152 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site