From: Chris Wilson Date: Fri, 19 Aug 2016 07:37:50 +0000 (+0100) Subject: drm: Avoid calling dev_printk(.dev = NULL) X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b4ba97e76763c4e582e3af1079e220e93b1b0d76;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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: c4e68a583202 ("drm: Introduce DRM_DEV_* log messages") Signed-off-by: Chris Wilson Cc: Eric Engestrom Cc: Sean Paul Signed-off-by: Sean Paul Link: http://patchwork.freedesktop.org/patch/msgid/20160819073750.16610-1-chris@chris-wilson.co.uk --- diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index a7f628298365..acf6a5f38920 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -79,8 +79,11 @@ void drm_dev_printk(const struct device *dev, const char *level, vaf.fmt = format; vaf.va = &args; - dev_printk(level, dev, DRM_PRINTK_FMT, function_name, prefix, - &vaf); + if (dev) + dev_printk(level, dev, DRM_PRINTK_FMT, function_name, prefix, + &vaf); + else + printk("%s" DRM_PRINTK_FMT, level, function_name, prefix, &vaf); va_end(args); }