rk3288: judge mmu status when deinitialize register structure
authorljf <ljf@rock-chips.com>
Mon, 26 May 2014 07:28:11 +0000 (15:28 +0800)
committerljf <ljf@rock-chips.com>
Mon, 26 May 2014 07:28:11 +0000 (15:28 +0800)
arch/arm/mach-rockchip/vcodec_service.c

index 14b1a5b150550bee4facec9a0f1be0f66156d1ef..1d410e28d9ab5aca7d01681348fc57c84fa744ae 100755 (executable)
@@ -871,11 +871,13 @@ static void reg_deinit(struct vpu_service_info *pservice, vpu_reg *reg)
 \r
 #if defined(CONFIG_VCODEC_MMU)\r
        // release memory region attach to this registers table.\r
-       list_for_each_entry_safe(mem_region, n, &reg->mem_region_list, reg_lnk) {\r
-               ion_unmap_iommu(pservice->dev, pservice->ion_client, mem_region->hdl);\r
-               ion_free(pservice->ion_client, mem_region->hdl);\r
-               list_del_init(&mem_region->reg_lnk);\r
-               kfree(mem_region);\r
+       if (pservice->mmu_dev) {\r
+               list_for_each_entry_safe(mem_region, n, &reg->mem_region_list, reg_lnk) {\r
+                       ion_unmap_iommu(pservice->dev, pservice->ion_client, mem_region->hdl);\r
+                       ion_free(pservice->ion_client, mem_region->hdl);\r
+                       list_del_init(&mem_region->reg_lnk);\r
+                       kfree(mem_region);\r
+               }\r
        }\r
 #endif\r
 \r