Skip to content

Commit

Permalink
ACPI: scan: Unify the log message printing
Browse files Browse the repository at this point in the history
The log messages in scan.c is not in consistency, some pr_*() calls
have PREFIX, but some don't.

Using pr_fmt() and remove PREFIX, also replace printk() with pr_*()
macro to unify the message printing.

Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Hanjun Guo authored and Rafael J. Wysocki committed Jun 7, 2021
1 parent bd10c13 commit 8acf410
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* scan.c - support for transforming the ACPI namespace into individual objects
*/

#define pr_fmt(fmt) "ACPI: " fmt

#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -729,7 +731,7 @@ int acpi_device_add(struct acpi_device *device,

result = acpi_device_setup_files(device);
if (result)
printk(KERN_ERR PREFIX "Error creating sysfs interface for device %s\n",
pr_err("Error creating sysfs interface for device %s\n",
dev_name(&device->dev));

return 0;
Expand Down Expand Up @@ -1320,8 +1322,7 @@ static void acpi_set_pnp_ids(acpi_handle handle, struct acpi_device_pnp *pnp,

acpi_get_object_info(handle, &info);
if (!info) {
pr_err(PREFIX "%s: Error reading device info\n",
__func__);
pr_err("%s: Error reading device info\n", __func__);
return;
}

Expand Down Expand Up @@ -2278,7 +2279,7 @@ static void __init acpi_get_spcr_uart_addr(void)
status = acpi_get_table(ACPI_SIG_SPCR, 0,
(struct acpi_table_header **)&spcr_ptr);
if (ACPI_FAILURE(status)) {
pr_warn(PREFIX "STAO table present, but SPCR is missing\n");
pr_warn("STAO table present, but SPCR is missing\n");
return;
}

Expand Down Expand Up @@ -2319,7 +2320,7 @@ int __init acpi_scan_init(void)
(struct acpi_table_header **)&stao_ptr);
if (ACPI_SUCCESS(status)) {
if (stao_ptr->header.length > sizeof(struct acpi_table_stao))
pr_info(PREFIX "STAO Name List not yet supported.\n");
pr_info("STAO Name List not yet supported.\n");

if (stao_ptr->ignore_uart)
acpi_get_spcr_uart_addr();
Expand Down

0 comments on commit 8acf410

Please sign in to comment.