Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/print: Handle NULL drm device in __drm_printk()

drm_{err,warn,...}() use __drm_printk() which takes a drm device pointer and
uses the embedded device pointer to print the device. This facility handles
NULL device pointer, but not NULL drm device pointer. This patch makes
__drm_printk() also handle a NULL drm device pointer. The printed output is
identical to if drm->dev had been NULL.

Signed-off-by: Luben Tuikov <ltuikov89@gmail.com>
Reviewed-by: Jani Nikula <jani.nikula@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231117035427.68125-2-ltuikov89@gmail.com

+1 -1
+1 -1
include/drm/drm_print.h
··· 453 453 454 454 /* Helper for struct drm_device based logging. */ 455 455 #define __drm_printk(drm, level, type, fmt, ...) \ 456 - dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__) 456 + dev_##level##type((drm) ? (drm)->dev : NULL, "[drm] " fmt, ##__VA_ARGS__) 457 457 458 458 459 459 #define drm_info(drm, fmt, ...) \