ACPI / bus: Use acpi_handle_debug() in acpi_print_osc_error()
[cascardo/linux.git] / drivers / acpi / bus.c
index c068c82..a6bb8ae 100644 (file)
@@ -174,22 +174,17 @@ void acpi_bus_detach_private_data(acpi_handle handle)
 EXPORT_SYMBOL_GPL(acpi_bus_detach_private_data);
 
 static void acpi_print_osc_error(acpi_handle handle,
-       struct acpi_osc_context *context, char *error)
+                                struct acpi_osc_context *context, char *error)
 {
-       struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER};
        int i;
 
-       if (ACPI_FAILURE(acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer)))
-               printk(KERN_DEBUG "%s: %s\n", context->uuid_str, error);
-       else {
-               printk(KERN_DEBUG "%s (%s): %s\n",
-                      (char *)buffer.pointer, context->uuid_str, error);
-               kfree(buffer.pointer);
-       }
-       printk(KERN_DEBUG "_OSC request data:");
+       acpi_handle_debug(handle, "(%s): %s\n", context->uuid_str, error);
+
+       pr_debug("_OSC request data:");
        for (i = 0; i < context->cap.length; i += sizeof(u32))
-               printk(" %x", *((u32 *)(context->cap.pointer + i)));
-       printk("\n");
+               pr_debug(" %x", *((u32 *)(context->cap.pointer + i)));
+
+       pr_debug("\n");
 }
 
 acpi_status acpi_str_to_uuid(char *str, u8 *uuid)
@@ -925,11 +920,13 @@ void __init acpi_early_init(void)
                goto error0;
        }
 
-       status = acpi_load_tables();
-       if (ACPI_FAILURE(status)) {
-               printk(KERN_ERR PREFIX
-                      "Unable to load the System Description Tables\n");
-               goto error0;
+       if (acpi_gbl_group_module_level_code) {
+               status = acpi_load_tables();
+               if (ACPI_FAILURE(status)) {
+                       printk(KERN_ERR PREFIX
+                              "Unable to load the System Description Tables\n");
+                       goto error0;
+               }
        }
 
 #ifdef CONFIG_X86
@@ -995,17 +992,10 @@ static int __init acpi_bus_init(void)
 
        acpi_os_initialize1();
 
-       status = acpi_enable_subsystem(ACPI_NO_ACPI_ENABLE);
-       if (ACPI_FAILURE(status)) {
-               printk(KERN_ERR PREFIX
-                      "Unable to start the ACPI Interpreter\n");
-               goto error1;
-       }
-
        /*
         * ACPI 2.0 requires the EC driver to be loaded and work before
-        * the EC device is found in the namespace (i.e. before acpi_initialize_objects()
-        * is called).
+        * the EC device is found in the namespace (i.e. before
+        * acpi_load_tables() is called).
         *
         * This is accomplished by looking for the ECDT table, and getting
         * the EC parameters out of that.
@@ -1013,6 +1003,22 @@ static int __init acpi_bus_init(void)
        status = acpi_ec_ecdt_probe();
        /* Ignore result. Not having an ECDT is not fatal. */
 
+       if (!acpi_gbl_group_module_level_code) {
+               status = acpi_load_tables();
+               if (ACPI_FAILURE(status)) {
+                       printk(KERN_ERR PREFIX
+                              "Unable to load the System Description Tables\n");
+                       goto error1;
+               }
+       }
+
+       status = acpi_enable_subsystem(ACPI_NO_ACPI_ENABLE);
+       if (ACPI_FAILURE(status)) {
+               printk(KERN_ERR PREFIX
+                      "Unable to start the ACPI Interpreter\n");
+               goto error1;
+       }
+
        status = acpi_initialize_objects(ACPI_FULL_INITIALIZATION);
        if (ACPI_FAILURE(status)) {
                printk(KERN_ERR PREFIX "Unable to initialize ACPI objects\n");
@@ -1040,7 +1046,7 @@ static int __init acpi_bus_init(void)
         * Maybe EC region is required at bus_scan/acpi_get_devices. So it
         * is necessary to enable it as early as possible.
         */
-       acpi_boot_ec_enable();
+       acpi_ec_dsdt_probe();
 
        printk(KERN_INFO PREFIX "Interpreter enabled\n");