gpu: ion: tegra: Ignore unsupported heap with printing warning
Hiroshi DOYU [Thu, 5 Jan 2012 08:57:43 +0000 (10:57 +0200)]
Instead of rewinding and returning error for unsupported heap,
continuie to next heap with printing warning. If some kind of heap
isn't supported, it doesn't have to cancel Ion memory manager itself.

Change-Id: I0d2c8dc1b9fc69318309f90dc657b10a3bd866bb
Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
Reviewed-on: http://git-master/r/73607
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>

drivers/gpu/ion/tegra/tegra_ion.c

index ab5f3f9..a750a22 100644 (file)
@@ -297,7 +297,6 @@ static long tegra_ion_ioctl(struct ion_client *client,
 int tegra_ion_probe(struct platform_device *pdev)
 {
        struct ion_platform_data *pdata = pdev->dev.platform_data;
-       int err;
        int i;
 
        num_heaps = pdata->nr;
@@ -316,8 +315,10 @@ int tegra_ion_probe(struct platform_device *pdev)
 
                heaps[i] = ion_heap_create(heap_data);
                if (IS_ERR_OR_NULL(heaps[i])) {
-                       err = PTR_ERR(heaps[i]);
-                       goto err;
+                       pr_warn("%s(type:%d id:%d) isn't supported\n",
+                               heap_data->name,
+                               heap_data->type, heap_data->id);
+                       continue;
                }
                ion_device_add_heap(idev, heaps[i]);
        }
@@ -326,13 +327,6 @@ int tegra_ion_probe(struct platform_device *pdev)
        nvmap_dev = (struct nvmap_device *)idev;
 #endif
        return 0;
-err:
-       for (i = 0; i < num_heaps; i++) {
-               if (heaps[i])
-                       ion_heap_destroy(heaps[i]);
-       }
-       kfree(heaps);
-       return err;
 }
 
 int tegra_ion_remove(struct platform_device *pdev)