diff options
author | Jani Nikula <jani.nikula@intel.com> | 2024-01-16 16:07:26 +0300 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2024-02-09 12:51:13 +0300 |
commit | 5e0c04c8c40b69ab165d52964433859d8b666376 (patch) | |
tree | 706ceedb0dbe72ffe41f174f425156c5ba56d3e7 /include/drm | |
parent | 27b8f91c08d99d267ac6096d4733203161274cbb (diff) | |
download | linux-5e0c04c8c40b69ab165d52964433859d8b666376.tar.xz |
drm/print: make drm_err_printer() device specific by using drm_err()
With few users for drm_err_printer(), it's still feasible to convert it
to be device specific. Use drm_err() under the hood.
While at it, make the prefix optional.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/2a9cdcfc1df44568078f7c131e2e7e0f7c94e97e.1705410327.git.jani.nikula@intel.com
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drm_print.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index dd4883df876a..3d899fb0793c 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -35,6 +35,8 @@ #include <drm/drm.h> +struct drm_device; + /* Do *not* use outside of drm_print.[ch]! */ extern unsigned long __drm_debug; @@ -235,16 +237,19 @@ static inline struct drm_printer drm_debug_printer(const char *prefix) } /** - * drm_err_printer - construct a &drm_printer that outputs to pr_err() - * @prefix: debug output prefix + * drm_err_printer - construct a &drm_printer that outputs to drm_err() + * @drm: the &struct drm_device pointer + * @prefix: debug output prefix, or NULL for no prefix * * RETURNS: * The &drm_printer object */ -static inline struct drm_printer drm_err_printer(const char *prefix) +static inline struct drm_printer drm_err_printer(struct drm_device *drm, + const char *prefix) { struct drm_printer p = { .printfn = __drm_printfn_err, + .arg = drm, .prefix = prefix }; return p; |