Skip to content

Commit f5ee87d

Browse files
guohanjunrafaeljw
authored andcommitted
ACPI: sleep: Unify the message printing
Intoduce pr_fmt() and use pr_*() macros to replace printk(), also remove all the PREFIX for pr_*() calls to generate a unified format string for prefix. Signed-off-by: Hanjun Guo <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent f7e02c8 commit f5ee87d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

drivers/acpi/sleep.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* Copyright (c) 2003 Open Source Development Lab
99
*/
1010

11+
#define pr_fmt(fmt) "ACPI: PM: " fmt
12+
1113
#include <linux/delay.h>
1214
#include <linux/irq.h>
1315
#include <linux/dmi.h>
@@ -41,7 +43,7 @@ static void acpi_sleep_tts_switch(u32 acpi_state)
4143
* OS can't evaluate the _TTS object correctly. Some warning
4244
* message will be printed. But it won't break anything.
4345
*/
44-
printk(KERN_NOTICE "Failure in evaluating _TTS object\n");
46+
pr_notice("Failure in evaluating _TTS object\n");
4547
}
4648
}
4749

@@ -73,8 +75,7 @@ static int acpi_sleep_prepare(u32 acpi_state)
7375
}
7476
ACPI_FLUSH_CPU_CACHE();
7577
#endif
76-
printk(KERN_INFO PREFIX "Preparing to enter system sleep state S%d\n",
77-
acpi_state);
78+
pr_info("Preparing to enter system sleep state S%d\n", acpi_state);
7879
acpi_enable_wakeup_devices(acpi_state);
7980
acpi_enter_sleep_state_prep(acpi_state);
8081
return 0;
@@ -459,8 +460,7 @@ static void acpi_pm_finish(void)
459460
if (acpi_state == ACPI_STATE_S0)
460461
return;
461462

462-
printk(KERN_INFO PREFIX "Waking up from system sleep state S%d\n",
463-
acpi_state);
463+
pr_info("Waking up from system sleep state S%d\n", acpi_state);
464464
acpi_disable_wakeup_devices(acpi_state);
465465
acpi_leave_sleep_state(acpi_state);
466466

@@ -581,7 +581,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
581581
error = acpi_suspend_lowlevel();
582582
if (error)
583583
return error;
584-
pr_info(PREFIX "Low-level resume complete\n");
584+
pr_info("Low-level resume complete\n");
585585
pm_set_resume_via_firmware();
586586
break;
587587
}
@@ -921,7 +921,7 @@ static void acpi_hibernation_leave(void)
921921
acpi_leave_sleep_state_prep(ACPI_STATE_S4);
922922
/* Check the hardware signature */
923923
if (facs && s4_hardware_signature != facs->hardware_signature)
924-
pr_crit("ACPI: Hardware changed while hibernated, success doubtful!\n");
924+
pr_crit("Hardware changed while hibernated, success doubtful!\n");
925925
/* Restore the NVS memory area */
926926
suspend_nvs_restore();
927927
/* Allow EC transactions to happen. */
@@ -1029,7 +1029,7 @@ static void acpi_power_off_prepare(void)
10291029
static void acpi_power_off(void)
10301030
{
10311031
/* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */
1032-
printk(KERN_DEBUG "%s called\n", __func__);
1032+
pr_debug("%s called\n", __func__);
10331033
local_irq_disable();
10341034
acpi_enter_sleep_state(ACPI_STATE_S5);
10351035
}
@@ -1061,7 +1061,7 @@ int __init acpi_sleep_init(void)
10611061
if (sleep_states[i])
10621062
pos += sprintf(pos, " S%d", i);
10631063
}
1064-
pr_info(PREFIX "(supports%s)\n", supported);
1064+
pr_info("(supports%s)\n", supported);
10651065

10661066
/*
10671067
* Register the tts_notifier to reboot notifier list so that the _TTS

0 commit comments

Comments
 (0)