linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: joro@8bytes.org, will@kernel.org
Cc: iommu@lists.linux-foundation.org, sven@svenpeter.dev,
	robdclark@gmail.com, m.szyprowski@samsung.com,
	baolu.lu@linux.intel.com, yong.wu@mediatek.com,
	mjrosato@linux.ibm.com, gerald.schaefer@linux.ibm.com,
	zhang.lyra@gmail.com, thierry.reding@gmail.com,
	vdumpa@nvidia.com, jean-philippe@linaro.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2 07/14] iommu/dart: Clean up bus_set_iommu()
Date: Thu, 28 Apr 2022 14:18:08 +0100	[thread overview]
Message-ID: <2a56bc5322c02da954d7890c5b162768f57c3277.1650890638.git.robin.murphy@arm.com> (raw)
In-Reply-To: <cover.1650890638.git.robin.murphy@arm.com>

Stop calling bus_set_iommu() since it's now unnecessary, and simplify
the probe failure path accordingly.

Tested-by: Sven Peter <sven@svenpeter.dev>
Reviewed-by: Sven Peter <sven@svenpeter.dev>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 drivers/iommu/apple-dart.c | 30 +-----------------------------
 1 file changed, 1 insertion(+), 29 deletions(-)

diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c
index decafb07ad08..a679e4c02291 100644
--- a/drivers/iommu/apple-dart.c
+++ b/drivers/iommu/apple-dart.c
@@ -823,27 +823,6 @@ static irqreturn_t apple_dart_irq(int irq, void *dev)
 	return IRQ_HANDLED;
 }
 
-static int apple_dart_set_bus_ops(const struct iommu_ops *ops)
-{
-	int ret;
-
-	if (!iommu_present(&platform_bus_type)) {
-		ret = bus_set_iommu(&platform_bus_type, ops);
-		if (ret)
-			return ret;
-	}
-#ifdef CONFIG_PCI
-	if (!iommu_present(&pci_bus_type)) {
-		ret = bus_set_iommu(&pci_bus_type, ops);
-		if (ret) {
-			bus_set_iommu(&platform_bus_type, NULL);
-			return ret;
-		}
-	}
-#endif
-	return 0;
-}
-
 static int apple_dart_probe(struct platform_device *pdev)
 {
 	int ret;
@@ -899,14 +878,10 @@ static int apple_dart_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, dart);
 
-	ret = apple_dart_set_bus_ops(&apple_dart_iommu_ops);
-	if (ret)
-		goto err_free_irq;
-
 	ret = iommu_device_sysfs_add(&dart->iommu, dev, NULL, "apple-dart.%s",
 				     dev_name(&pdev->dev));
 	if (ret)
-		goto err_remove_bus_ops;
+		goto err_free_irq;
 
 	ret = iommu_device_register(&dart->iommu, &apple_dart_iommu_ops, dev);
 	if (ret)
@@ -920,8 +895,6 @@ static int apple_dart_probe(struct platform_device *pdev)
 
 err_sysfs_remove:
 	iommu_device_sysfs_remove(&dart->iommu);
-err_remove_bus_ops:
-	apple_dart_set_bus_ops(NULL);
 err_free_irq:
 	free_irq(dart->irq, dart);
 err_clk_disable:
@@ -936,7 +909,6 @@ static int apple_dart_remove(struct platform_device *pdev)
 
 	apple_dart_hw_reset(dart);
 	free_irq(dart->irq, dart);
-	apple_dart_set_bus_ops(NULL);
 
 	iommu_device_unregister(&dart->iommu);
 	iommu_device_sysfs_remove(&dart->iommu);
-- 
2.35.3.dirty


  parent reply	other threads:[~2022-04-28 13:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-28 13:18 [PATCH v2 00/14] iommu: Retire bus_set_iommu() Robin Murphy
2022-04-28 13:18 ` [PATCH v2 01/14] iommu/vt-d: Temporarily reject probing non-PCI devices Robin Murphy
2022-04-28 13:18 ` [PATCH v2 02/14] iommu: Always register bus notifiers Robin Murphy
2022-04-28 13:18 ` [PATCH v2 03/14] iommu: Move bus setup to IOMMU device registration Robin Murphy
2022-04-29  6:57   ` Baolu Lu
2022-04-29  8:50     ` Robin Murphy
2022-04-29 18:06       ` Robin Murphy
2022-07-05  4:51         ` Baolu Lu
2022-07-05  9:06           ` Robin Murphy
2022-04-28 13:18 ` [PATCH v2 04/14] iommu/amd: Clean up bus_set_iommu() Robin Murphy
2022-04-28 13:18 ` [PATCH v2 05/14] iommu/arm-smmu: " Robin Murphy
2022-04-28 13:18 ` [PATCH v2 06/14] iommu/arm-smmu-v3: " Robin Murphy
2022-04-28 13:18 ` Robin Murphy [this message]
2022-04-28 13:18 ` [PATCH v2 08/14] iommu/exynos: " Robin Murphy
2022-04-28 13:18 ` [PATCH v2 09/14] iommu/ipmmu-vmsa: " Robin Murphy
2022-07-06  8:38   ` Alexey Kardashevskiy
2022-07-06 10:54     ` Robin Murphy
2022-04-28 13:18 ` [PATCH v2 10/14] iommu/mtk: " Robin Murphy
2022-04-28 13:18 ` [PATCH v2 11/14] iommu/omap: " Robin Murphy
2022-04-28 13:18 ` [PATCH v2 12/14] iommu/tegra-smmu: " Robin Murphy
2022-04-28 13:18 ` [PATCH v2 13/14] iommu/virtio: " Robin Murphy
2022-04-28 13:18 ` [PATCH v2 14/14] iommu: " Robin Murphy
2022-04-28 14:16 ` [PATCH v2 00/14] iommu: Retire bus_set_iommu() Robin Murphy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2a56bc5322c02da954d7890c5b162768f57c3277.1650890638.git.robin.murphy@arm.com \
    --to=robin.murphy@arm.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=gerald.schaefer@linux.ibm.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jean-philippe@linaro.org \
    --cc=joro@8bytes.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=robdclark@gmail.com \
    --cc=sven@svenpeter.dev \
    --cc=thierry.reding@gmail.com \
    --cc=vdumpa@nvidia.com \
    --cc=will@kernel.org \
    --cc=yong.wu@mediatek.com \
    --cc=zhang.lyra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).