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)
commit7911902129a8c4dbc45c3ffb57126d11e042aef4
treedb2885579c6e7842d78447d9fd9a78d988a9df06
parentc869c5f8ceca43d61db2176f88a0321f4ce50961
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