drm: Avoid calling dev_printk(.dev = NULL)

Since dev_printk likes to print "(NULL device *):" when passed in a NULL
pointer, we have to manually call printk() ourselves.

Fixes: c4e68a5832 ("drm: Introduce DRM_DEV_* log messages")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Eric Engestrom <eric.engestrom@imgtec.com>
Cc: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20160819073750.16610-1-chris@chris-wilson.co.uk
This commit is contained in:
Chris Wilson 2016-08-19 08:37:50 +01:00 committed by Sean Paul
parent ec913f31a5
commit b4ba97e767
1 changed files with 5 additions and 2 deletions

View File

@ -79,8 +79,11 @@ void drm_dev_printk(const struct device *dev, const char *level,
vaf.fmt = format; vaf.fmt = format;
vaf.va = &args; vaf.va = &args;
if (dev)
dev_printk(level, dev, DRM_PRINTK_FMT, function_name, prefix, dev_printk(level, dev, DRM_PRINTK_FMT, function_name, prefix,
&vaf); &vaf);
else
printk("%s" DRM_PRINTK_FMT, level, function_name, prefix, &vaf);
va_end(args); va_end(args);
} }