Skip to content

Commit

Permalink
Merge branches 'acpi-dptf' and 'acpi-messages'
Browse files Browse the repository at this point in the history
* acpi-dptf:
  ACPI: DPTF: Add battery participant for Intel SoCs

* acpi-messages:
  ACPI: Remove the macro PREFIX "ACPI: "
  ACPI: sleep: Unify the message printing
  ACPI: sbs: Unify the message printing
  ACPI: scan: Unify the log message printing
  ACPI: sbshc: Unify the message printing
  ACPI: sysfs: Cleanup message printing
  ACPI: reboot: Unify the message printing
  ACPI: processor_throttling: Cleanup the printing messages
  ACPI: processor_perflib: Cleanup print messages
  ACPI: processor_thermal: Remove unused PREFIX for printing
  ACPI: pci_root: Unify the message printing
  ACPI: osl: Remove the duplicated PREFIX for message printing
  ACPI: nvs: Unify the message printing
  ACPI: glue: Clean up the printing messages
  ACPI: event: Use pr_*() macros to replace printk()
  ACPI: bus: Use pr_*() macros to replace printk()
  ACPI: blacklist: Unify the message printing
  ACPI: cmos_rtc: Using pr_fmt() and remove PREFIX
  • Loading branch information
Rafael J. Wysocki committed Jun 29, 2021
3 parents 3a616ec + 7d96611 + 0ac2c0e commit 8b457d6
Show file tree
Hide file tree
Showing 19 changed files with 108 additions and 121 deletions.
6 changes: 4 additions & 2 deletions drivers/acpi/acpi_cmos_rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* Authors: Lan Tianyu <tianyu.lan@intel.com>
*/

#define pr_fmt(fmt) "ACPI: " fmt

#include <linux/acpi.h>
#include <linux/device.h>
#include <linux/err.h>
Expand Down Expand Up @@ -59,7 +61,7 @@ static int acpi_install_cmos_rtc_space_handler(struct acpi_device *adev,
&acpi_cmos_rtc_space_handler,
NULL, NULL);
if (ACPI_FAILURE(status)) {
pr_err(PREFIX "Error installing CMOS-RTC region handler\n");
pr_err("Error installing CMOS-RTC region handler\n");
return -ENODEV;
}

Expand All @@ -70,7 +72,7 @@ static void acpi_remove_cmos_rtc_space_handler(struct acpi_device *adev)
{
if (ACPI_FAILURE(acpi_remove_address_space_handler(adev->handle,
ACPI_ADR_SPACE_CMOS, &acpi_cmos_rtc_space_handler)))
pr_err(PREFIX "Error removing CMOS-RTC region handler\n");
pr_err("Error removing CMOS-RTC region handler\n");
}

static struct acpi_scan_handler cmos_rtc_handler = {
Expand Down
9 changes: 5 additions & 4 deletions drivers/acpi/blacklist.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* Copyright (C) 2002 Andy Grover <andrew.grover@intel.com>
*/

#define pr_fmt(fmt) "ACPI: " fmt

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/acpi.h>
Expand Down Expand Up @@ -49,12 +51,12 @@ int __init acpi_blacklisted(void)

i = acpi_match_platform_list(acpi_blacklist);
if (i >= 0) {
pr_err(PREFIX "Vendor \"%6.6s\" System \"%8.8s\" Revision 0x%x has a known ACPI BIOS problem.\n",
pr_err("Vendor \"%6.6s\" System \"%8.8s\" Revision 0x%x has a known ACPI BIOS problem.\n",
acpi_blacklist[i].oem_id,
acpi_blacklist[i].oem_table_id,
acpi_blacklist[i].oem_revision);

pr_err(PREFIX "Reason: %s. This is a %s error\n",
pr_err("Reason: %s. This is a %s error\n",
acpi_blacklist[i].reason,
(acpi_blacklist[i].data ?
"non-recoverable" : "recoverable"));
Expand All @@ -73,8 +75,7 @@ int __init acpi_blacklisted(void)
#ifdef CONFIG_ACPI_REV_OVERRIDE_POSSIBLE
static int __init dmi_enable_rev_override(const struct dmi_system_id *d)
{
printk(KERN_NOTICE PREFIX "DMI detected: %s (force ACPI _REV to 5)\n",
d->ident);
pr_notice("DMI detected: %s (force ACPI _REV to 5)\n", d->ident);
acpi_rev_override_setup(NULL);
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ EXPORT_SYMBOL_GPL(osc_sb_native_usb4_control);

static void acpi_bus_decode_usb_osc(const char *msg, u32 bits)
{
printk(KERN_INFO PREFIX "%s USB3%c DisplayPort%c PCIe%c XDomain%c\n", msg,
pr_info("%s USB3%c DisplayPort%c PCIe%c XDomain%c\n", msg,
(bits & OSC_USB_USB3_TUNNELING) ? '+' : '-',
(bits & OSC_USB_DP_TUNNELING) ? '+' : '-',
(bits & OSC_USB_PCIE_TUNNELING) ? '+' : '-',
Expand Down Expand Up @@ -398,7 +398,7 @@ static void acpi_bus_osc_negotiate_usb_control(void)
return;

if (context.ret.length != sizeof(capbuf)) {
printk(KERN_INFO PREFIX "USB4 _OSC: returned invalid length buffer\n");
pr_info("USB4 _OSC: returned invalid length buffer\n");
goto out_free;
}

Expand Down
2 changes: 2 additions & 0 deletions drivers/acpi/dptf/int340x_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ static const struct acpi_device_id int340x_thermal_device_ids[] = {
{"INT3409"},
{"INT340A"},
{"INT340B"},
{"INT3532"},
{"INTC1040"},
{"INTC1041"},
{"INTC1043"},
Expand All @@ -33,6 +34,7 @@ static const struct acpi_device_id int340x_thermal_device_ids[] = {
{"INTC1047"},
{"INTC1048"},
{"INTC1049"},
{"INTC1050"},
{"INTC1060"},
{"INTC1061"},
{""},
Expand Down
6 changes: 4 additions & 2 deletions drivers/acpi/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
*
*/

#define pr_fmt(fmt) "ACPI: " fmt

#include <linux/spinlock.h>
#include <linux/export.h>
#include <linux/proc_fs.h>
Expand Down Expand Up @@ -173,8 +175,8 @@ static int __init acpi_event_init(void)
/* create genetlink for acpi event */
error = acpi_event_genetlink_init();
if (error)
printk(KERN_WARNING PREFIX
"Failed to create genetlink family for ACPI event\n");
pr_warn("Failed to create genetlink family for ACPI event\n");

return 0;
}

Expand Down
29 changes: 9 additions & 20 deletions drivers/acpi/glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* Copyright (c) 2005 Intel Corp.
*/

#define pr_fmt(fmt) "ACPI: " fmt

#include <linux/acpi_iort.h>
#include <linux/export.h>
#include <linux/init.h>
Expand All @@ -19,17 +21,6 @@

#include "internal.h"

#define ACPI_GLUE_DEBUG 0
#if ACPI_GLUE_DEBUG
#define DBG(fmt, ...) \
printk(KERN_DEBUG PREFIX fmt, ##__VA_ARGS__)
#else
#define DBG(fmt, ...) \
do { \
if (0) \
printk(KERN_DEBUG PREFIX fmt, ##__VA_ARGS__); \
} while (0)
#endif
static LIST_HEAD(bus_type_list);
static DECLARE_RWSEM(bus_type_sem);

Expand All @@ -44,7 +35,7 @@ int register_acpi_bus_type(struct acpi_bus_type *type)
down_write(&bus_type_sem);
list_add_tail(&type->list, &bus_type_list);
up_write(&bus_type_sem);
printk(KERN_INFO PREFIX "bus type %s registered\n", type->name);
pr_info("bus type %s registered\n", type->name);
return 0;
}
return -ENODEV;
Expand All @@ -59,8 +50,7 @@ int unregister_acpi_bus_type(struct acpi_bus_type *type)
down_write(&bus_type_sem);
list_del_init(&type->list);
up_write(&bus_type_sem);
printk(KERN_INFO PREFIX "bus type %s unregistered\n",
type->name);
pr_info("bus type %s unregistered\n", type->name);
return 0;
}
return -ENODEV;
Expand Down Expand Up @@ -307,7 +297,7 @@ static int acpi_device_notify(struct device *dev)

adev = type->find_companion(dev);
if (!adev) {
DBG("Unable to get handle for %s\n", dev_name(dev));
pr_debug("Unable to get handle for %s\n", dev_name(dev));
ret = -ENODEV;
goto out;
}
Expand All @@ -328,16 +318,15 @@ static int acpi_device_notify(struct device *dev)
adev->handler->bind(dev);

out:
#if ACPI_GLUE_DEBUG
if (!ret) {
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };

acpi_get_name(ACPI_HANDLE(dev), ACPI_FULL_PATHNAME, &buffer);
DBG("Device %s -> %s\n", dev_name(dev), (char *)buffer.pointer);
pr_debug("Device %s -> %s\n", dev_name(dev), (char *)buffer.pointer);
kfree(buffer.pointer);
} else
DBG("Device %s -> No ACPI support\n", dev_name(dev));
#endif
} else {
pr_debug("Device %s -> No ACPI support\n", dev_name(dev));
}

return ret;
}
Expand Down
2 changes: 0 additions & 2 deletions drivers/acpi/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

#include <linux/idr.h>

#define PREFIX "ACPI: "

int early_acpi_osi_init(void);
int acpi_osi_init(void);
acpi_status acpi_os_initialize1(void);
Expand Down
8 changes: 5 additions & 3 deletions drivers/acpi/nvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Copyright (C) 2008-2011 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc.
*/

#define pr_fmt(fmt) "ACPI: PM: " fmt

#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/list.h>
Expand Down Expand Up @@ -94,7 +96,7 @@ static int suspend_nvs_register(unsigned long start, unsigned long size)
{
struct nvs_page *entry, *next;

pr_info("PM: Registering ACPI NVS region [mem %#010lx-%#010lx] (%ld bytes)\n",
pr_info("Registering ACPI NVS region [mem %#010lx-%#010lx] (%ld bytes)\n",
start, start + size - 1, size);

while (size > 0) {
Expand Down Expand Up @@ -170,7 +172,7 @@ int suspend_nvs_save(void)
{
struct nvs_page *entry;

printk(KERN_INFO "PM: Saving platform NVS memory\n");
pr_info("Saving platform NVS memory\n");

list_for_each_entry(entry, &nvs_list, node)
if (entry->data) {
Expand Down Expand Up @@ -202,7 +204,7 @@ void suspend_nvs_restore(void)
{
struct nvs_page *entry;

printk(KERN_INFO "PM: Restoring platform NVS memory\n");
pr_info("Restoring platform NVS memory\n");

list_for_each_entry(entry, &nvs_list, node)
if (entry->data)
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ acpi_physical_address __init acpi_os_get_root_pointer(void)
return efi.acpi20;
if (efi.acpi != EFI_INVALID_TABLE_ADDR)
return efi.acpi;
pr_err(PREFIX "System description tables not found\n");
pr_err("System description tables not found\n");
} else if (IS_ENABLED(CONFIG_ACPI_LEGACY_TABLES_LOOKUP)) {
acpi_find_root_pointer(&pa);
}
Expand Down Expand Up @@ -430,7 +430,7 @@ void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size)
map = acpi_map_lookup_virt(virt, size);
if (!map) {
mutex_unlock(&acpi_ioremap_lock);
WARN(true, PREFIX "%s: bad address %p\n", __func__, virt);
WARN(true, "ACPI: %s: bad address %p\n", __func__, virt);
return;
}
acpi_os_drop_map_ref(map);
Expand Down
4 changes: 3 additions & 1 deletion drivers/acpi/pci_root.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
*/

#define pr_fmt(fmt) "ACPI: " fmt

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
Expand Down Expand Up @@ -574,7 +576,7 @@ static int acpi_pci_root_add(struct acpi_device *device,
goto end;
}

pr_info(PREFIX "%s [%s] (domain %04x %pR)\n",
pr_info("%s [%s] (domain %04x %pR)\n",
acpi_device_name(device), acpi_device_bid(device),
root->segment, &root->secondary);

Expand Down
Loading

0 comments on commit 8b457d6

Please sign in to comment.