camera: rockchip: camsys_drv: 0.0x22.0x2
authorzhangyunlong <dalon.zhang@rock-chips.com>
Thu, 13 Jul 2017 02:53:58 +0000 (10:53 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Thu, 13 Jul 2017 03:40:01 +0000 (11:40 +0800)
modify the condition of DRM iommu, which makes code  more readable
by using of_parse_phandle to check whether the "iommus" phandle exists
in the isp device node.

Change-Id: I41d2c1c1e237364f19d79abb15aaca4a81616287
Signed-off-by: zhangyunlong <dalon.zhang@rock-chips.com>
drivers/media/video/rk_camsys/camsys_internal.h
drivers/media/video/rk_camsys/camsys_marvin.c

index 62a47882bc565a9f8aecfc4cbbd824bdb1f36215..0c533d22311714399ee771b044e7a7f3f4da704e 100644 (file)
        1) delete node in irqpool list when thread disconnect.
 *v0.0x22.1:
        1) gpio0_D is unavailable on rk3288 with current pinctrl driver.
+*v0.0x22.2:
+       1) modify the condition of DRM iommu, which makes code  more readable
+       by using of_parse_phandle to check whether the "iommus" phandle exists
+       in the isp device node.
 */
-#define CAMSYS_DRIVER_VERSION                   KERNEL_VERSION(0, 0x22, 1)
+#define CAMSYS_DRIVER_VERSION                   KERNEL_VERSION(0, 0x22, 2)
 
 #define CAMSYS_PLATFORM_DRV_NAME                "RockChip-CamSys"
 #define CAMSYS_PLATFORM_MARVIN_NAME             "Platform_MarvinDev"
index bc388414b71f818151e43b852c38d5f68e2b9406..036aa6b44736ed2d8f38ded447ff1cd7e0276bf1 100644 (file)
@@ -928,7 +928,7 @@ int camsys_mrv_probe_cb(struct platform_device *pdev, camsys_dev_t *camsys_dev)
        int err = 0;
        camsys_mrv_clk_t *mrv_clk = NULL;
        struct resource register_res;
-       struct iommu_domain *domain;
+       struct iommu_domain *domain = NULL;
        struct iommu_group *group;
        struct device_node *np;
 
@@ -1105,8 +1105,8 @@ int camsys_mrv_probe_cb(struct platform_device *pdev, camsys_dev_t *camsys_dev)
        mrv_clk->in_on = false;
        mrv_clk->out_on = 0;
 
-       np = of_find_node_by_name(NULL, "isp0_mmu");
-       if (!np) {
+       np = of_parse_phandle(pdev->dev.of_node, "iommus", 0);
+       if (np) {
                int index = 0;
                /* iommu domain */
                domain = iommu_domain_alloc(&platform_bus_type);
@@ -1174,9 +1174,11 @@ misc_register_failed:
        if (!IS_ERR_OR_NULL(camsys_dev->miscdev.this_device))
                misc_deregister(&camsys_dev->miscdev);
 err_put_cookie:
-       iommu_put_dma_cookie(domain);
+       if (domain)
+               iommu_put_dma_cookie(domain);
 err_free_domain:
-       iommu_domain_free(domain);
+       if (domain)
+               iommu_domain_free(domain);
 clk_failed:
        if (mrv_clk != NULL) {
                if (!IS_ERR_OR_NULL(mrv_clk->pd_isp))