PM / suspend: Define pr_fmt() in suspend.c
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 21 Jul 2017 12:50:48 +0000 (14:50 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 24 Jul 2017 21:57:46 +0000 (23:57 +0200)
Define a common prefix ("PM:") for messages printed by the
code in kernel/power/suspend.c.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
kernel/power/suspend.c

index a3d270e2e313f80f589e876f5eba1f1846bcc0e6..4bce46ddc2cdaedff55bd52f419647074e7902a9 100644 (file)
@@ -8,6 +8,8 @@
  * This file is released under the GPLv2.
  */
 
+#define pr_fmt(fmt) "PM: " fmt
+
 #include <linux/string.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
@@ -391,7 +393,7 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
 
        error = dpm_suspend_late(PMSG_SUSPEND);
        if (error) {
-               pr_err("PM: late suspend of devices failed\n");
+               pr_err("late suspend of devices failed\n");
                goto Platform_finish;
        }
        error = platform_suspend_prepare_late(state);
@@ -405,7 +407,7 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
 
        error = dpm_suspend_noirq(PMSG_SUSPEND);
        if (error) {
-               pr_err("PM: noirq suspend of devices failed\n");
+               pr_err("noirq suspend of devices failed\n");
                goto Platform_early_resume;
        }
        error = platform_suspend_prepare_noirq(state);
@@ -481,7 +483,7 @@ int suspend_devices_and_enter(suspend_state_t state)
        suspend_test_start();
        error = dpm_suspend_start(PMSG_SUSPEND);
        if (error) {
-               pr_err("PM: Some devices failed to suspend, or early wake event detected\n");
+               pr_err("Some devices failed to suspend, or early wake event detected\n");
                goto Recover_platform;
        }
        suspend_test_finish("suspend devices");
@@ -539,7 +541,7 @@ static int enter_state(suspend_state_t state)
        if (state == PM_SUSPEND_FREEZE) {
 #ifdef CONFIG_PM_DEBUG
                if (pm_test_level != TEST_NONE && pm_test_level <= TEST_CPUS) {
-                       pr_warn("PM: Unsupported test mode for suspend to idle, please choose none/freezer/devices/platform.\n");
+                       pr_warn("Unsupported test mode for suspend to idle, please choose none/freezer/devices/platform.\n");
                        return -EAGAIN;
                }
 #endif
@@ -554,7 +556,7 @@ static int enter_state(suspend_state_t state)
 
 #ifndef CONFIG_SUSPEND_SKIP_SYNC
        trace_suspend_resume(TPS("sync_filesystems"), 0, true);
-       pr_info("PM: Syncing filesystems ... ");
+       pr_info("Syncing filesystems ... ");
        sys_sync();
        pr_cont("done.\n");
        trace_suspend_resume(TPS("sync_filesystems"), 0, false);
@@ -597,7 +599,7 @@ int pm_suspend(suspend_state_t state)
        if (state <= PM_SUSPEND_ON || state >= PM_SUSPEND_MAX)
                return -EINVAL;
 
-       pr_info("PM: suspend entry (%s)\n", mem_sleep_labels[state]);
+       pr_info("suspend entry (%s)\n", mem_sleep_labels[state]);
        error = enter_state(state);
        if (error) {
                suspend_stats.fail++;
@@ -605,7 +607,7 @@ int pm_suspend(suspend_state_t state)
        } else {
                suspend_stats.success++;
        }
-       pr_info("PM: suspend exit\n");
+       pr_info("suspend exit\n");
        return error;
 }
 EXPORT_SYMBOL(pm_suspend);