[Intel-gfx] [RFC 6/6] drm: Respect driver set DRM_LOG_NAME in drm_info_printer
Tvrtko Ursulin
tursulin at ursulin.net
Wed Jan 24 16:18:21 UTC 2018
From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Same as the previous patch did for drm_printk, allow for the logging
macros to pass in the driver set DRM_LOG_NAME for drm_info_printer.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Cc: Daniel Vetter <daniel.vetter at intel.com>
Cc: Gustavo Padovan <gustavo at padovan.org>
Cc: Sean Paul <seanpaul at chromium.org>
Cc: David Airlie <airlied at linux.ie>
Cc: dri-devel at lists.freedesktop.org
---
drivers/gpu/drm/drm_print.c | 2 +-
include/drm/drm_print.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c
index f97bfcb7d882..1fcc08876f87 100644
--- a/drivers/gpu/drm/drm_print.c
+++ b/drivers/gpu/drm/drm_print.c
@@ -38,7 +38,7 @@ EXPORT_SYMBOL(__drm_printfn_seq_file);
void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf)
{
- dev_info(p->arg, "[" DRM_LOG_NAME "] %pV", vaf);
+ dev_info(p->arg, "[%s] %pV", p->prefix, vaf);
}
EXPORT_SYMBOL(__drm_printfn_info);
diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
index c4dfcd217bce..1f613b49c8f2 100644
--- a/include/drm/drm_print.h
+++ b/include/drm/drm_print.h
@@ -139,6 +139,7 @@ static inline struct drm_printer drm_info_printer(struct device *dev)
struct drm_printer p = {
.printfn = __drm_printfn_info,
.arg = dev,
+ .prefix = DRM_LOG_NAME,
};
return p;
}
--
2.14.1
More information about the Intel-gfx
mailing list