Skip to content

Commit

Permalink
PM: sleep: Use dev_printk() when possible
Browse files Browse the repository at this point in the history
[ Upstream commit eb23d91 ]

Use dev_printk() when possible to make messages more consistent with other
device-related messages.

Signed-off-by: Bjorn Helgaas <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
Stable-dep-of: 7839d00 ("PM: sleep: Fix possible deadlocks in core system-wide PM code")
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
bjorn-helgaas authored and gregkh committed Feb 23, 2024
1 parent 8a6a51b commit 2245a84
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/base/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

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

#include <linux/device.h>
#include <linux/export.h>
Expand Down Expand Up @@ -449,8 +450,8 @@ 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,
int error)
{
pr_err("Device %s failed to %s%s: error %d\n",
dev_name(dev), pm_verb(state.event), info, error);
dev_err(dev, "failed to %s%s: error %d\n", pm_verb(state.event), info,
error);
}

static void dpm_show_time(ktime_t starttime, pm_message_t state, int error,
Expand Down Expand Up @@ -1898,8 +1899,8 @@ int dpm_prepare(pm_message_t state)
error = 0;
continue;
}
pr_info("Device %s not prepared for power transition: code %d\n",
dev_name(dev), error);
dev_info(dev, "not prepared for power transition: code %d\n",
error);
put_device(dev);
break;
}
Expand Down

0 comments on commit 2245a84

Please sign in to comment.