Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI: button: Clean up printing messages

Replace the ACPI_DEBUG_PRINT() instance in button.c with an
acpi_handle_debug() call, drop the _COMPONENT and ACPI_MODULE_NAME()
definitions that are not used any more, drop the no longer needed
ACPI_BUTTON_COMPONENT definition from the headers and update the
documentation accordingly.

While at it, replace the direct printk() invocations with pr_info()
(that changes the excessive log level for some of them too) and drop
the unneeded PREFIX sybmbol definition from battery.c.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>

+5 -13
-1
Documentation/firmware-guide/acpi/debug.rst
··· 52 52 ACPI_CA_DISASSEMBLER 0x00000800 53 53 ACPI_COMPILER 0x00001000 54 54 ACPI_TOOLS 0x00002000 55 - ACPI_BUTTON_COMPONENT 0x00080000 56 55 ACPI_SBS_COMPONENT 0x00100000 57 56 ACPI_FAN_COMPONENT 0x00200000 58 57 ACPI_PCI_COMPONENT 0x00400000
+5 -10
drivers/acpi/button.c
··· 21 21 #include <linux/dmi.h> 22 22 #include <acpi/button.h> 23 23 24 - #define PREFIX "ACPI: " 25 - 26 24 #define ACPI_BUTTON_CLASS "button" 27 25 #define ACPI_BUTTON_FILE_STATE "state" 28 26 #define ACPI_BUTTON_TYPE_UNKNOWN 0x00 ··· 51 53 [ACPI_BUTTON_LID_INIT_METHOD] = "method", 52 54 [ACPI_BUTTON_LID_INIT_DISABLED] = "disabled", 53 55 }; 54 - 55 - #define _COMPONENT ACPI_BUTTON_COMPONENT 56 - ACPI_MODULE_NAME("button"); 57 56 58 57 MODULE_AUTHOR("Paul Diefenbaugh"); 59 58 MODULE_DESCRIPTION("ACPI Button Driver"); ··· 280 285 return 0; 281 286 282 287 if (acpi_button_dir || acpi_lid_dir) { 283 - printk(KERN_ERR PREFIX "More than one Lid device found!\n"); 288 + pr_info("More than one Lid device found!\n"); 284 289 return -EEXIST; 285 290 } 286 291 ··· 429 434 } 430 435 break; 431 436 default: 432 - ACPI_DEBUG_PRINT((ACPI_DB_INFO, 433 - "Unsupported event [0x%x]\n", event)); 437 + acpi_handle_debug(device->handle, "Unsupported event [0x%x]\n", 438 + event); 434 439 break; 435 440 } 436 441 } ··· 518 523 ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_LID); 519 524 input->open = acpi_lid_input_open; 520 525 } else { 521 - printk(KERN_ERR PREFIX "Unsupported hid [%s]\n", hid); 526 + pr_info("Unsupported hid [%s]\n", hid); 522 527 error = -ENODEV; 523 528 goto err_free_input; 524 529 } ··· 562 567 } 563 568 564 569 device_init_wakeup(&device->dev, true); 565 - printk(KERN_INFO PREFIX "%s [%s]\n", name, acpi_device_bid(device)); 570 + pr_info("%s [%s]\n", name, acpi_device_bid(device)); 566 571 return 0; 567 572 568 573 err_remove_fs:
-1
drivers/acpi/sysfs.c
··· 52 52 ACPI_DEBUG_INIT(ACPI_COMPILER), 53 53 ACPI_DEBUG_INIT(ACPI_TOOLS), 54 54 55 - ACPI_DEBUG_INIT(ACPI_BUTTON_COMPONENT), 56 55 ACPI_DEBUG_INIT(ACPI_SBS_COMPONENT), 57 56 ACPI_DEBUG_INIT(ACPI_FAN_COMPONENT), 58 57 ACPI_DEBUG_INIT(ACPI_PCI_COMPONENT),
-1
include/acpi/acpi_drivers.h
··· 15 15 * Please update drivers/acpi/debug.c and Documentation/firmware-guide/acpi/debug.rst 16 16 * if you add to this list. 17 17 */ 18 - #define ACPI_BUTTON_COMPONENT 0x00080000 19 18 #define ACPI_SBS_COMPONENT 0x00100000 20 19 #define ACPI_FAN_COMPONENT 0x00200000 21 20 #define ACPI_PCI_COMPONENT 0x00400000