From: zhangyunlong Date: Thu, 13 Jul 2017 02:53:58 +0000 (+0800) Subject: camera: rockchip: camsys_drv: 0.0x22.0x2 X-Git-Tag: release-20171130_firefly~4^2~197 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6ce1035676af794b13554d599411d87ecead5887;p=firefly-linux-kernel-4.4.55.git camera: rockchip: camsys_drv: 0.0x22.0x2 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 --- diff --git a/drivers/media/video/rk_camsys/camsys_internal.h b/drivers/media/video/rk_camsys/camsys_internal.h index 62a47882bc56..0c533d223117 100644 --- a/drivers/media/video/rk_camsys/camsys_internal.h +++ b/drivers/media/video/rk_camsys/camsys_internal.h @@ -168,8 +168,12 @@ 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" diff --git a/drivers/media/video/rk_camsys/camsys_marvin.c b/drivers/media/video/rk_camsys/camsys_marvin.c index bc388414b71f..036aa6b44736 100644 --- a/drivers/media/video/rk_camsys/camsys_marvin.c +++ b/drivers/media/video/rk_camsys/camsys_marvin.c @@ -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))