drm/print: Add drm_err_printer()
[linux-2.6-microblaze.git] / include / drm / drm_print.h
index 3a42473..112165d 100644 (file)
@@ -32,6 +32,8 @@
 #include <linux/device.h>
 #include <linux/debugfs.h>
 
+#include <drm/drm.h>
+
 /**
  * DOC: print
  *
@@ -81,6 +83,7 @@ void __drm_printfn_seq_file(struct drm_printer *p, struct va_format *vaf);
 void __drm_puts_seq_file(struct drm_printer *p, const char *str);
 void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf);
 void __drm_printfn_debug(struct drm_printer *p, struct va_format *vaf);
+void __drm_printfn_err(struct drm_printer *p, struct va_format *vaf);
 
 __printf(2, 3)
 void drm_printf(struct drm_printer *p, const char *f, ...);
@@ -225,6 +228,22 @@ static inline struct drm_printer drm_debug_printer(const char *prefix)
        return p;
 }
 
+/**
+ * drm_err_printer - construct a &drm_printer that outputs to pr_err()
+ * @prefix: debug output prefix
+ *
+ * RETURNS:
+ * The &drm_printer object
+ */
+static inline struct drm_printer drm_err_printer(const char *prefix)
+{
+       struct drm_printer p = {
+               .printfn = __drm_printfn_err,
+               .prefix = prefix
+       };
+       return p;
+}
+
 /*
  * The following categories are defined:
  *