Commit 7a5bd127 authored by Joe Perches's avatar Joe Perches Committed by Rafael J. Wysocki

PM: Add and use pr_fmt()

Prefix all printk/pr_<level> messages with "PM: " to make the
logging a bit more consistent.

Miscellanea:

 o Convert a few printks to pr_<level>
 o Whitespace to align to open parentheses
 o Remove embedded "PM: " from pr_debugs as pr_fmt adds it
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarKevin Hilman <khilman@baylibre.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent ef800684
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
* This file is released under the GPLv2. * This file is released under the GPLv2.
*/ */
#define pr_fmt(fmt) "PM: " fmt
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/io.h> #include <linux/io.h>
...@@ -1657,8 +1659,8 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, ...@@ -1657,8 +1659,8 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
genpd_lock_nested(genpd, SINGLE_DEPTH_NESTING); genpd_lock_nested(genpd, SINGLE_DEPTH_NESTING);
if (!list_empty(&subdomain->master_links) || subdomain->device_count) { if (!list_empty(&subdomain->master_links) || subdomain->device_count) {
pr_warn("%s: unable to remove subdomain %s\n", genpd->name, pr_warn("%s: unable to remove subdomain %s\n",
subdomain->name); genpd->name, subdomain->name);
ret = -EBUSY; ret = -EBUSY;
goto out; goto out;
} }
...@@ -1767,7 +1769,7 @@ int pm_genpd_init(struct generic_pm_domain *genpd, ...@@ -1767,7 +1769,7 @@ int pm_genpd_init(struct generic_pm_domain *genpd,
if (ret) if (ret)
return ret; return ret;
} else if (!gov) { } else if (!gov) {
pr_warn("%s : no governor for states\n", genpd->name); pr_warn("%s: no governor for states\n", genpd->name);
} }
device_initialize(&genpd->dev); device_initialize(&genpd->dev);
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
* subsystem list maintains. * subsystem list maintains.
*/ */
#define pr_fmt(fmt) "PM: " fmt
#include <linux/device.h> #include <linux/device.h>
#include <linux/export.h> #include <linux/export.h>
#include <linux/mutex.h> #include <linux/mutex.h>
...@@ -128,7 +130,7 @@ void device_pm_add(struct device *dev) ...@@ -128,7 +130,7 @@ void device_pm_add(struct device *dev)
if (device_pm_not_required(dev)) if (device_pm_not_required(dev))
return; return;
pr_debug("PM: Adding info for %s:%s\n", pr_debug("Adding info for %s:%s\n",
dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); dev->bus ? dev->bus->name : "No Bus", dev_name(dev));
device_pm_check_callbacks(dev); device_pm_check_callbacks(dev);
mutex_lock(&dpm_list_mtx); mutex_lock(&dpm_list_mtx);
...@@ -149,7 +151,7 @@ void device_pm_remove(struct device *dev) ...@@ -149,7 +151,7 @@ void device_pm_remove(struct device *dev)
if (device_pm_not_required(dev)) if (device_pm_not_required(dev))
return; return;
pr_debug("PM: Removing info for %s:%s\n", pr_debug("Removing info for %s:%s\n",
dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); dev->bus ? dev->bus->name : "No Bus", dev_name(dev));
complete_all(&dev->power.completion); complete_all(&dev->power.completion);
mutex_lock(&dpm_list_mtx); mutex_lock(&dpm_list_mtx);
...@@ -168,7 +170,7 @@ void device_pm_remove(struct device *dev) ...@@ -168,7 +170,7 @@ void device_pm_remove(struct device *dev)
*/ */
void device_pm_move_before(struct device *deva, struct device *devb) void device_pm_move_before(struct device *deva, struct device *devb)
{ {
pr_debug("PM: Moving %s:%s before %s:%s\n", pr_debug("Moving %s:%s before %s:%s\n",
deva->bus ? deva->bus->name : "No Bus", dev_name(deva), deva->bus ? deva->bus->name : "No Bus", dev_name(deva),
devb->bus ? devb->bus->name : "No Bus", dev_name(devb)); devb->bus ? devb->bus->name : "No Bus", dev_name(devb));
/* Delete deva from dpm_list and reinsert before devb. */ /* Delete deva from dpm_list and reinsert before devb. */
...@@ -182,7 +184,7 @@ void device_pm_move_before(struct device *deva, struct device *devb) ...@@ -182,7 +184,7 @@ void device_pm_move_before(struct device *deva, struct device *devb)
*/ */
void device_pm_move_after(struct device *deva, struct device *devb) void device_pm_move_after(struct device *deva, struct device *devb)
{ {
pr_debug("PM: Moving %s:%s after %s:%s\n", pr_debug("Moving %s:%s after %s:%s\n",
deva->bus ? deva->bus->name : "No Bus", dev_name(deva), deva->bus ? deva->bus->name : "No Bus", dev_name(deva),
devb->bus ? devb->bus->name : "No Bus", dev_name(devb)); devb->bus ? devb->bus->name : "No Bus", dev_name(devb));
/* Delete deva from dpm_list and reinsert after devb. */ /* Delete deva from dpm_list and reinsert after devb. */
...@@ -195,7 +197,7 @@ void device_pm_move_after(struct device *deva, struct device *devb) ...@@ -195,7 +197,7 @@ void device_pm_move_after(struct device *deva, struct device *devb)
*/ */
void device_pm_move_last(struct device *dev) void device_pm_move_last(struct device *dev)
{ {
pr_debug("PM: Moving %s:%s to end of list\n", pr_debug("Moving %s:%s to end of list\n",
dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); dev->bus ? dev->bus->name : "No Bus", dev_name(dev));
list_move_tail(&dev->power.entry, &dpm_list); list_move_tail(&dev->power.entry, &dpm_list);
} }
...@@ -418,7 +420,7 @@ static void pm_dev_dbg(struct device *dev, pm_message_t state, const char *info) ...@@ -418,7 +420,7 @@ static void pm_dev_dbg(struct device *dev, pm_message_t state, const char *info)
static void pm_dev_err(struct device *dev, pm_message_t state, const char *info, static void pm_dev_err(struct device *dev, pm_message_t state, const char *info,
int error) int error)
{ {
printk(KERN_ERR "PM: Device %s failed to %s%s: error %d\n", pr_err("Device %s failed to %s%s: error %d\n",
dev_name(dev), pm_verb(state.event), info, error); dev_name(dev), pm_verb(state.event), info, error);
} }
...@@ -2022,8 +2024,7 @@ int dpm_prepare(pm_message_t state) ...@@ -2022,8 +2024,7 @@ int dpm_prepare(pm_message_t state)
error = 0; error = 0;
continue; continue;
} }
printk(KERN_INFO "PM: Device %s not prepared " pr_info("Device %s not prepared for power transition: code %d\n",
"for power transition: code %d\n",
dev_name(dev), error); dev_name(dev), error);
put_device(dev); put_device(dev);
break; break;
...@@ -2062,7 +2063,7 @@ EXPORT_SYMBOL_GPL(dpm_suspend_start); ...@@ -2062,7 +2063,7 @@ EXPORT_SYMBOL_GPL(dpm_suspend_start);
void __suspend_report_result(const char *function, void *fn, int ret) void __suspend_report_result(const char *function, void *fn, int ret)
{ {
if (ret) if (ret)
printk(KERN_ERR "%s(): %pF returns %d\n", function, fn, ret); pr_err("%s(): %pF returns %d\n", function, fn, ret);
} }
EXPORT_SYMBOL_GPL(__suspend_report_result); EXPORT_SYMBOL_GPL(__suspend_report_result);
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
* devices may be working. * devices may be working.
*/ */
#define pr_fmt(fmt) "PM: " fmt
#include <linux/pm-trace.h> #include <linux/pm-trace.h>
#include <linux/export.h> #include <linux/export.h>
#include <linux/rtc.h> #include <linux/rtc.h>
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
* This file is released under the GPLv2. * This file is released under the GPLv2.
*/ */
#define pr_fmt(fmt) "PM: " fmt
#include <linux/device.h> #include <linux/device.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/sched/signal.h> #include <linux/sched/signal.h>
...@@ -853,7 +855,7 @@ bool pm_wakeup_pending(void) ...@@ -853,7 +855,7 @@ bool pm_wakeup_pending(void)
raw_spin_unlock_irqrestore(&events_lock, flags); raw_spin_unlock_irqrestore(&events_lock, flags);
if (ret) { if (ret) {
pr_debug("PM: Wakeup pending, aborting suspend\n"); pr_debug("Wakeup pending, aborting suspend\n");
pm_print_active_wakeup_sources(); pm_print_active_wakeup_sources();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment