gpu: ion: Remove unnecessary error handling
Hiroshi DOYU [Mon, 16 Jan 2012 09:00:20 +0000 (11:00 +0200)]
Ion core takes care of the case failing allocaion. Remove unnecessary
code and obsolete comment.

Change-Id: I0a27f6697beb1b3e802275eb01bfdc4fc0ae3ae2
Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
Reviewed-on: http://git-master/r/75533
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

drivers/gpu/ion/ion_iommu_heap.c

index 5821464..691d8c7 100644 (file)
@@ -164,10 +164,9 @@ static int iommu_heap_allocate(struct ion_heap *heap, struct ion_buffer *buf,
        len = round_up(len, PAGE_SIZE);
 
        da = gen_pool_alloc(h->pool, len);
-       if (!da) {
-               buf->priv_virt = (void *)ION_CARVEOUT_ALLOCATE_FAIL;
+       if (!da)
                return -ENOMEM;
-       }
+
        buf->priv_virt = (void *)da;
        buf->size = len;
 
@@ -200,16 +199,6 @@ static void iommu_heap_free(struct ion_buffer *buf)
                container_of(heap, struct ion_iommu_heap, heap);
        void *da = buf->priv_virt;
 
-       /*
-        * FIXME:
-        * Buf should not be in use.
-        * Forcibly remove iommu mappings, if any exists.
-        * Free physical pages here.
-        */
-
-       if (da == (void *)ION_CARVEOUT_ALLOCATE_FAIL)
-               return;
-
        iommu_heap_unmap_dma(heap, buf);
        ion_buffer_free(buf);
        gen_pool_free(h->pool, (unsigned long)da, buf->size);