diff options
author | Joonyoung Shim <jy0922.shim@samsung.com> | 2015-08-16 14:15:06 +0900 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2015-08-16 14:15:48 +0900 |
commit | c4130bcd6a80f29a5d0cabcef8f0341cfa812dff (patch) | |
tree | ea67287550f10dd570bcfbbe9c75e367de164dd8 /drivers/gpu/drm/exynos | |
parent | 5f3f42664fafa7dd88aee30a2ea77ca45c9362e7 (diff) |
drm/exynos: remove function check_gem_flags
The function check_gem_flags is too simple, so it's better to move codes
in each consumer functions.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_gem.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index d7a687bd0006..a8849ed30a50 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -20,16 +20,6 @@ #include "exynos_drm_buf.h" #include "exynos_drm_iommu.h" -static int check_gem_flags(unsigned int flags) -{ - if (flags & ~(EXYNOS_BO_MASK)) { - DRM_ERROR("invalid flags.\n"); - return -EINVAL; - } - - return 0; -} - static void update_vm_cache_attr(struct exynos_drm_gem_obj *obj, struct vm_area_struct *vma) { @@ -164,6 +154,11 @@ struct exynos_drm_gem_obj *exynos_drm_gem_create(struct drm_device *dev, struct exynos_drm_gem_buf *buf; int ret; + if (flags & ~(EXYNOS_BO_MASK)) { + DRM_ERROR("invalid flags.\n"); + return ERR_PTR(-EINVAL); + } + if (!size) { DRM_ERROR("invalid size.\n"); return ERR_PTR(-EINVAL); @@ -171,10 +166,6 @@ struct exynos_drm_gem_obj *exynos_drm_gem_create(struct drm_device *dev, size = roundup_gem_size(size, flags); - ret = check_gem_flags(flags); - if (ret) - return ERR_PTR(ret); - buf = exynos_drm_init_buf(dev, size); if (!buf) return ERR_PTR(-ENOMEM); @@ -585,10 +576,6 @@ int exynos_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma) obj = vma->vm_private_data; exynos_gem_obj = to_exynos_gem_obj(obj); - ret = check_gem_flags(exynos_gem_obj->flags); - if (ret) - goto err_close_vm; - update_vm_cache_attr(exynos_gem_obj, vma); ret = exynos_drm_gem_mmap_buffer(exynos_gem_obj, vma); |