Commit 64b3eaf3 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Boris Ostrovsky

xenbus: Use dev_printk() when possible

Use dev_printk() when possible to include device and driver information in
the conventional format.

Add "#define dev_fmt" to preserve KBUILD_MODNAME in messages.

No functional change intended.
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/20200527174326.254329-3-helgaas@kernel.orgReviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
parent 69049454
......@@ -31,6 +31,7 @@
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#define dev_fmt pr_fmt
#define DPRINTK(fmt, args...) \
pr_debug("xenbus_probe (%s:%d) " fmt ".\n", \
......@@ -608,7 +609,7 @@ int xenbus_dev_suspend(struct device *dev)
if (drv->suspend)
err = drv->suspend(xdev);
if (err)
pr_warn("suspend %s failed: %i\n", dev_name(dev), err);
dev_warn(dev, "suspend failed: %i\n", err);
return 0;
}
EXPORT_SYMBOL_GPL(xenbus_dev_suspend);
......@@ -627,8 +628,7 @@ int xenbus_dev_resume(struct device *dev)
drv = to_xenbus_driver(dev->driver);
err = talk_to_otherend(xdev);
if (err) {
pr_warn("resume (talk_to_otherend) %s failed: %i\n",
dev_name(dev), err);
dev_warn(dev, "resume (talk_to_otherend) failed: %i\n", err);
return err;
}
......@@ -637,15 +637,14 @@ int xenbus_dev_resume(struct device *dev)
if (drv->resume) {
err = drv->resume(xdev);
if (err) {
pr_warn("resume %s failed: %i\n", dev_name(dev), err);
dev_warn(dev, "resume failed: %i\n", err);
return err;
}
}
err = watch_otherend(xdev);
if (err) {
pr_warn("resume (watch_otherend) %s failed: %d.\n",
dev_name(dev), err);
dev_warn(dev, "resume (watch_otherend) failed: %d\n", err);
return err;
}
......
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