diff options
author | Jani Nikula <jani.nikula@intel.com> | 2013-09-27 08:08:29 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-10-01 01:28:56 -0400 |
commit | 4ddc773b60497dcefbd9824f8931ae297659e6cc (patch) | |
tree | b4572161146c807596ad1c8a3257a4f4385c867a /drivers/gpu/drm | |
parent | 51f8da5916f85c18b696f74f97970e5a7330147e (diff) |
drm/exynos: use drm_edid_duplicate
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_vidi.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c index 4400330e4449..26e089f4ff1c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c | |||
@@ -101,7 +101,6 @@ static struct edid *vidi_get_edid(struct device *dev, | |||
101 | { | 101 | { |
102 | struct vidi_context *ctx = get_vidi_context(dev); | 102 | struct vidi_context *ctx = get_vidi_context(dev); |
103 | struct edid *edid; | 103 | struct edid *edid; |
104 | int edid_len; | ||
105 | 104 | ||
106 | /* | 105 | /* |
107 | * the edid data comes from user side and it would be set | 106 | * the edid data comes from user side and it would be set |
@@ -112,8 +111,7 @@ static struct edid *vidi_get_edid(struct device *dev, | |||
112 | return ERR_PTR(-EFAULT); | 111 | return ERR_PTR(-EFAULT); |
113 | } | 112 | } |
114 | 113 | ||
115 | edid_len = (1 + ctx->raw_edid->extensions) * EDID_LENGTH; | 114 | edid = drm_edid_duplicate(ctx->raw_edid); |
116 | edid = kmemdup(ctx->raw_edid, edid_len, GFP_KERNEL); | ||
117 | if (!edid) { | 115 | if (!edid) { |
118 | DRM_DEBUG_KMS("failed to allocate edid\n"); | 116 | DRM_DEBUG_KMS("failed to allocate edid\n"); |
119 | return ERR_PTR(-ENOMEM); | 117 | return ERR_PTR(-ENOMEM); |
@@ -485,7 +483,6 @@ int vidi_connection_ioctl(struct drm_device *drm_dev, void *data, | |||
485 | struct exynos_drm_manager *manager; | 483 | struct exynos_drm_manager *manager; |
486 | struct exynos_drm_display_ops *display_ops; | 484 | struct exynos_drm_display_ops *display_ops; |
487 | struct drm_exynos_vidi_connection *vidi = data; | 485 | struct drm_exynos_vidi_connection *vidi = data; |
488 | int edid_len; | ||
489 | 486 | ||
490 | if (!vidi) { | 487 | if (!vidi) { |
491 | DRM_DEBUG_KMS("user data for vidi is null.\n"); | 488 | DRM_DEBUG_KMS("user data for vidi is null.\n"); |
@@ -524,8 +521,7 @@ int vidi_connection_ioctl(struct drm_device *drm_dev, void *data, | |||
524 | DRM_DEBUG_KMS("edid data is invalid.\n"); | 521 | DRM_DEBUG_KMS("edid data is invalid.\n"); |
525 | return -EINVAL; | 522 | return -EINVAL; |
526 | } | 523 | } |
527 | edid_len = (1 + raw_edid->extensions) * EDID_LENGTH; | 524 | ctx->raw_edid = drm_edid_duplicate(raw_edid); |
528 | ctx->raw_edid = kmemdup(raw_edid, edid_len, GFP_KERNEL); | ||
529 | if (!ctx->raw_edid) { | 525 | if (!ctx->raw_edid) { |
530 | DRM_DEBUG_KMS("failed to allocate raw_edid.\n"); | 526 | DRM_DEBUG_KMS("failed to allocate raw_edid.\n"); |
531 | return -ENOMEM; | 527 | return -ENOMEM; |