drm/gem: simplify object initialization
authorDavid Herrmann <dh.herrmann@gmail.com>
Thu, 11 Jul 2013 09:56:32 +0000 (11:56 +0200)
committerDave Airlie <airlied@gmail.com>
Tue, 23 Jul 2013 09:37:53 +0000 (19:37 +1000)
commit89c8233f82d9c8af5b20e72e4a185a38a7d3c50b
treeb693be2e67816f5073807ae93aa40b7f1538773d
parent23367ff49065505e4a255dba2117f654ca26063f
drm/gem: simplify object initialization

drm_gem_object_init() and drm_gem_private_object_init() do exactly the
same (except for shmem alloc) so make the first use the latter to reduce
code duplication.

Also drop the return code from drm_gem_private_object_init(). It seems
unlikely that we will extend it any time soon so no reason to keep it
around. This simplifies code paths in drivers, too.

Last but not least, fix gma500 to call drm_gem_object_release() before
freeing objects that were allocated via drm_gem_private_object_init().
That isn't actually necessary for now, but might be in the future.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Acked-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Dave Airlie <airlied@gmail.com>
drivers/gpu/drm/drm_gem.c
drivers/gpu/drm/gma500/framebuffer.c
drivers/gpu/drm/gma500/gem.c
drivers/gpu/drm/i915/i915_gem_dmabuf.c
drivers/gpu/drm/i915/i915_gem_stolen.c
drivers/gpu/drm/omapdrm/omap_gem.c
include/drm/drmP.h