@@ -2135,12 +2135,6 @@ int intel_pin_and_map_ringbuffer_obj(struct drm_device *dev,
return 0;
}
-static void intel_destroy_ringbuffer_obj(struct intel_ringbuffer *ringbuf)
-{
- drm_gem_object_unreference(&ringbuf->obj->base);
- ringbuf->obj = NULL;
-}
-
static int intel_alloc_ringbuffer_obj(struct drm_device *dev,
struct intel_ringbuffer *ringbuf)
{
@@ -2203,11 +2197,11 @@ struct intel_ringbuffer *
}
void
-intel_ringbuffer_free(struct intel_ringbuffer *ring)
+intel_ringbuffer_free(struct intel_ringbuffer *ringbuf)
{
- intel_destroy_ringbuffer_obj(ring);
- list_del(&ring->link);
- kfree(ring);
+ drm_gem_object_unreference(&ringbuf->obj->base);
+ list_del(&ringbuf->link);
+ kfree(ringbuf);
}
static int intel_init_ring_buffer(struct drm_device *dev,
After the last patch, there is only one caller of the trivial function intel_destroy_ringbuffer_obj(), so we might as well fold it into the caller. v3: Don't bother to clear a pointer in an object about to be freed. [Chris Wilson] v4: Don't bother to check for NULL pointer, as drm_gem_object_unreference can handle NULL [Chris Wilson]. This relies on 'base' being the very first member of 'struct intel_ringbuffer'! Signed-off-by: Dave Gordon <david.s.gordon@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> --- drivers/gpu/drm/i915/intel_ringbuffer.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)