[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250925122756.10910-13-johan@kernel.org>
Date: Thu, 25 Sep 2025 14:27:54 +0200
From: Johan Hovold <johan@...nel.org>
To: Joerg Roedel <joro@...tes.org>,
Will Deacon <will@...nel.org>
Cc: Robin Murphy <robin.murphy@....com>,
Sven Peter <sven@...nel.org>,
Janne Grunau <j@...nau.net>,
Rob Clark <robin.clark@....qualcomm.com>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Yong Wu <yong.wu@...iatek.com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Chen-Yu Tsai <wens@...e.org>,
Thierry Reding <thierry.reding@...il.com>,
Krishna Reddy <vdumpa@...dia.com>,
iommu@...ts.linux.dev,
linux-kernel@...r.kernel.org,
Johan Hovold <johan@...nel.org>
Subject: [PATCH 12/14] iommu/omap: simplify probe_device() error handling
Simplify the probe_device() error handling by dropping the iommu OF node
reference sooner.
Signed-off-by: Johan Hovold <johan@...nel.org>
---
drivers/iommu/omap-iommu.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index 77023d49bd24..844def804777 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -1668,23 +1668,20 @@ static struct iommu_device *omap_iommu_probe_device(struct device *dev)
}
pdev = of_find_device_by_node(np);
+ of_node_put(np);
if (!pdev) {
- of_node_put(np);
ret = -ENODEV;
goto err_put_iommus;
}
oiommu = platform_get_drvdata(pdev);
if (!oiommu) {
- of_node_put(np);
ret = -EINVAL;
goto err_put_iommus;
}
tmp->iommu_dev = oiommu;
tmp->dev = &pdev->dev;
-
- of_node_put(np);
}
dev_iommu_priv_set(dev, arch_data);
--
2.49.1
Powered by blists - more mailing lists