]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/print: require struct drm_device for drm_err() and friends
authorJani Nikula <jani.nikula@intel.com>
Thu, 23 Jan 2025 15:09:12 +0000 (17:09 +0200)
committerJani Nikula <jani.nikula@intel.com>
Tue, 4 Mar 2025 15:03:50 +0000 (17:03 +0200)
commitd05386a3fdf373a19ab1918846668f096e6f966a
tree28387d24e216f6c883c3c7416c5caa9da40ad0e7
parente5f3081291eb958b46775edfd29d1f5367078474
drm/print: require struct drm_device for drm_err() and friends

The expectation is that the struct drm_device based logging helpers get
passed an actual struct drm_device pointer rather than some random
struct pointer where you can dereference the ->dev member.

Add a static inline helper to convert struct drm_device to struct
device, with the main benefit being the type checking of the macro
argument.

As a side effect, this also reduces macro argument double references.

Reviewed-by: Simona Vetter <simona.vetter@ffwll.ch>
Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/dfe6e774883e6ef93cfaa2b6fe92b804061ab9d9.1737644530.git.jani.nikula@intel.com
include/drm/drm_print.h