From: Tvrtko Ursulin <[email protected]>

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 <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Gustavo Padovan <[email protected]>
Cc: Sean Paul <[email protected]>
Cc: David Airlie <[email protected]>
Cc: [email protected]
---
 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

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to