Commit 13e1d629 authored by Johan Hovold's avatar Johan Hovold Committed by Joerg Roedel
Browse files

iommu/omap: simplify probe_device() error handling



Simplify the probe_device() error handling by dropping the iommu OF node
reference sooner.

Acked-by: default avatarRobin Murphy <robin.murphy@arm.com>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarJoerg Roedel <joerg.roedel@amd.com>
parent b5870691
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -1668,8 +1668,8 @@ static struct iommu_device *omap_iommu_probe_device(struct device *dev)
		}

		pdev = of_find_device_by_node(np);
		if (!pdev) {
		of_node_put(np);
		if (!pdev) {
			kfree(arch_data);
			return ERR_PTR(-ENODEV);
		}
@@ -1677,14 +1677,11 @@ static struct iommu_device *omap_iommu_probe_device(struct device *dev)
		oiommu = platform_get_drvdata(pdev);
		put_device(&pdev->dev);
		if (!oiommu) {
			of_node_put(np);
			kfree(arch_data);
			return ERR_PTR(-EINVAL);
		}

		tmp->iommu_dev = oiommu;

		of_node_put(np);
	}

	dev_iommu_priv_set(dev, arch_data);