iommu/rockchip: fix old/new iommu driver conflict
authorMark Yao <mark.yao@rock-chips.com>
Mon, 11 Jul 2016 06:50:58 +0000 (14:50 +0800)
committerMark Yao <mark.yao@rock-chips.com>
Mon, 11 Jul 2016 06:56:38 +0000 (14:56 +0800)
Change-Id: I22fcf6be63aebe76417a470975c6c10bbc3ed92a
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
drivers/iommu/rk-iommu.c

index e2ae0d813cafd01357a0da4741ff4a06bd75a032..d63bb6f54d64ffc9d03e8339e83cf11c16a5901e 100644 (file)
@@ -1245,8 +1245,15 @@ static struct platform_driver rk_iommu_driver = {
 
 static int __init rockchip_iommu_init_driver(void)
 {
 
 static int __init rockchip_iommu_init_driver(void)
 {
+       struct device_node *np;
        int ret;
 
        int ret;
 
+       np = of_find_matching_node(NULL, iommu_dt_ids);
+       if (!np) {
+               pr_err("Failed to find legacy iommu devices\n");
+               return -ENODEV;
+       }
+
        lv2table_kmem_cache = kmem_cache_create("rk-iommu-lv2table",
                                                LV2TABLE_SIZE, LV2TABLE_SIZE,
                                                0, NULL);
        lv2table_kmem_cache = kmem_cache_create("rk-iommu-lv2table",
                                                LV2TABLE_SIZE, LV2TABLE_SIZE,
                                                0, NULL);