mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
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
This commit is contained in:
parent
13a3d91f17
commit
86bf546b33
1 changed files with 11 additions and 3 deletions
|
@ -1101,9 +1101,17 @@ int drm_encoder_init(struct drm_device *dev,
|
|||
encoder->dev = dev;
|
||||
encoder->encoder_type = encoder_type;
|
||||
encoder->funcs = funcs;
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue