summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_crtc.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2015-12-08 18:41:52 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-12-11 09:13:42 +0100
commit86bf546b339914b29f9068bcbb7696355e246a47 (patch)
tree6dfda2c35c450ebf18f4c7c36ac982d1c00781e9 /drivers/gpu/drm/drm_crtc.c
parent13a3d91f17a5f7ed2acd275d18b6acfdb131fb15 (diff)
downloadlwn-86bf546b339914b29f9068bcbb7696355e246a47.tar.gz
lwn-86bf546b339914b29f9068bcbb7696355e246a47.zip
drm: Use driver specified encoder name
Use the encoder name passed by the driver if non-NULL, otherwise fall back to the old style name. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1449592922-5545-5-git-send-email-ville.syrjala@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/drm_crtc.c')
-rw-r--r--drivers/gpu/drm/drm_crtc.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index b1111ea2b29d..aade4640fa6d 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -1101,9 +1101,17 @@ int drm_encoder_init(struct drm_device *dev,
encoder->dev = dev;
encoder->encoder_type = encoder_type;
encoder->funcs = funcs;
- encoder->name = kasprintf(GFP_KERNEL, "%s-%d",
- drm_encoder_enum_list[encoder_type].name,
- encoder->base.id);
+ if (name) {
+ va_list ap;
+
+ va_start(ap, name);
+ encoder->name = kvasprintf(GFP_KERNEL, name, ap);
+ va_end(ap);
+ } else {
+ encoder->name = kasprintf(GFP_KERNEL, "%s-%d",
+ drm_encoder_enum_list[encoder_type].name,
+ encoder->base.id);
+ }
if (!encoder->name) {
ret = -ENOMEM;
goto out_put;