platform: x86: ACPI: Get rid of ACPICA message printing
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 24 Feb 2021 18:41:44 +0000 (19:41 +0100)
committerHans de Goede <hdegoede@redhat.com>
Mon, 8 Mar 2021 10:33:39 +0000 (11:33 +0100)
A few x86 platform drivers use ACPI_DEBUG_PRINT() or ACPI_EXCEPTION()
for printing messages, but that is questionable, because those macros
belong to ACPICA and they should not be used elsewhere.  In addition,
ACPI_DEBUG_PRINT() requires special enabling to allow it to actually
print the message, which is a nuisance, and the _COMPONENT symbol
generally needed for that is not defined in any of the files in
question.

For this reason, replace the ACPI_DEBUG_PRINT() in lg-laptop.c with
pr_debug() and the one in xo15-ebook.c with acpi_handle_debug()
(with the additional benefit that the source object can be identified
more easily after this change).

Also drop the ACPI_MODULE_NAME() definitions that are only used by
the ACPICA message printing macros from those files and from wmi.c
and surfacepro3_button.c (while at it).

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/2074665.VPHYfYaQb6@kreacher
[hdegoede@redhat.com: Drop acer-wmi.c chunk, a similar patch was already merged]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/surface/surfacepro3_button.c
drivers/platform/x86/lg-laptop.c
drivers/platform/x86/wmi.c
drivers/platform/x86/xo15-ebook.c

index d8afed5db94c59f69f58e63e24e5976e9fae2ee7..242fb690dcaf7aff6998cbc22c3e753679fe6a84 100644 (file)
@@ -40,8 +40,6 @@ static const guid_t MSHW0040_DSM_UUID =
 #define SURFACE_BUTTON_NOTIFY_PRESS_VOLUME_DOWN                0xc2
 #define SURFACE_BUTTON_NOTIFY_RELEASE_VOLUME_DOWN      0xc3
 
-ACPI_MODULE_NAME("surface pro 3 button");
-
 MODULE_AUTHOR("Chen Yu");
 MODULE_DESCRIPTION("Surface Pro3 Button Driver");
 MODULE_LICENSE("GPL v2");
index dd900a76d8de5b3846407c88eb565a5eb2b2a3e3..20145b539335b79ee8070ab4cff69215eb05627f 100644 (file)
@@ -678,7 +678,7 @@ static int __init acpi_init(void)
 
        result = acpi_bus_register_driver(&acpi_driver);
        if (result < 0) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error registering driver\n"));
+               pr_debug("Error registering driver\n");
                return -ENODEV;
        }
 
index c669676ea8e8a6448e089161bd631f9e1b753e4c..f30d791be95be56c356947ed132a82addfa4f631 100644 (file)
@@ -32,7 +32,6 @@
 #include <linux/fs.h>
 #include <uapi/linux/wmi.h>
 
-ACPI_MODULE_NAME("wmi");
 MODULE_AUTHOR("Carlos Corbacho");
 MODULE_DESCRIPTION("ACPI-WMI Mapping Driver");
 MODULE_LICENSE("GPL");
index 8337c99d2ce25bab372cb82095fdb6a574eed74d..97440462aa258a4d5c52dd650895a75681828574 100644 (file)
@@ -26,8 +26,6 @@
 #define XO15_EBOOK_HID                 "XO15EBK"
 #define XO15_EBOOK_DEVICE_NAME         "EBook Switch"
 
-ACPI_MODULE_NAME(MODULE_NAME);
-
 MODULE_DESCRIPTION("OLPC XO-1.5 ebook switch driver");
 MODULE_LICENSE("GPL");
 
@@ -66,8 +64,8 @@ static void ebook_switch_notify(struct acpi_device *device, u32 event)
                ebook_send_state(device);
                break;
        default:
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                                 "Unsupported event [0x%x]\n", event));
+               acpi_handle_debug(device->handle,
+                                 "Unsupported event [0x%x]\n", event);
                break;
        }
 }