]> git.baikalelectronics.ru Git - kernel.git/commit
drm/print: Handle potentially NULL drm_devices in drm_dbg_*
authorLyude Paul <lyude@redhat.com>
Fri, 23 Apr 2021 18:43:06 +0000 (14:43 -0400)
committerLyude Paul <lyude@redhat.com>
Tue, 27 Apr 2021 22:43:44 +0000 (18:43 -0400)
commitd53f57013a7706ff8f1d31c73db66aa6603e3e1b
treedb2885579c6e7842d78447d9fd9a78d988a9df06
parent51fd050b1077946647e04e21aec4c37d9ddf4189
drm/print: Handle potentially NULL drm_devices in drm_dbg_*

While this shouldn't really be something that happens all that often, since
we're going to be using the drm_dbg_* log helpers in DRM helpers it's
technically possible that a driver could use an AUX adapter before it's
been associated with it's respective drm_device. While drivers should take
care to avoid this, there's likely going to be situations where it's
difficult to workaround. And since other logging helpers in the kernel tend
to be OK with NULL pointers (for instance, passing a NULL pointer to a "%s"
argument for a printk-like function in the kernel doesn't break anything),
we should do the same for ours.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210423184309.207645-15-lyude@redhat.com
Reviewed-by: Dave Airlie <airlied@redhat.com>
include/drm/drm_print.h