]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/iommu/of_iommu.c
iommu: of: Handle IOMMU lookup failure with deferred probing or error
[linux.git] / drivers / iommu / of_iommu.c
index c8be889f5206da5f4cf78be415e9427e0ea444a9..9f44ee8ea1bc8a10a6ff4c0dad297b78b8c2f57a 100644 (file)
@@ -236,7 +236,7 @@ const struct iommu_ops *of_iommu_configure(struct device *dev,
                        ops = ERR_PTR(err);
        }
 
-       return IS_ERR(ops) ? NULL : ops;
+       return ops;
 }
 
 static int __init of_iommu_init(void)
@@ -247,7 +247,7 @@ static int __init of_iommu_init(void)
        for_each_matching_node_and_match(np, matches, &match) {
                const of_iommu_init_fn init_fn = match->data;
 
-               if (init_fn(np))
+               if (init_fn && init_fn(np))
                        pr_err("Failed to initialise IOMMU %s\n",
                                of_node_full_name(np));
        }