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 <dalon.zhang@rock-chips.com>
This commit is contained in:
zhangyunlong
2017-07-13 10:53:58 +08:00
committed by Huang, Tao
parent 67e6174224
commit 6ce1035676
2 changed files with 12 additions and 6 deletions

View File

@@ -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"

View 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))