]> www.infradead.org Git - users/dwmw2/linux.git/commit
iommu: Resolve fwspec ops automatically
authorRobin Murphy <robin.murphy@arm.com>
Tue, 2 Jul 2024 11:40:48 +0000 (12:40 +0100)
committerWill Deacon <will@kernel.org>
Thu, 4 Jul 2024 13:36:03 +0000 (14:36 +0100)
commit3f7c320916282c26812d70cfe8830abb9e4dc696
treeee71ccfa4930e832a717fc91f7e3ef1a057d8978
parente7acc36f26b0b1a71dd068f4afd33d871352d67d
iommu: Resolve fwspec ops automatically

There's no real need for callers to resolve ops from a fwnode in order
to then pass both to iommu_fwspec_init() - it's simpler and more sensible
for that to resolve the ops itself. This in turn means we can centralise
the notion of checking for a present driver, and enforce that fwspecs
aren't allocated unless and until we know they will be usable.

Also use this opportunity to modernise with some "new" helpers that
arrived shortly after this code was first written; the generic
fwnode_handle_get() clears up that ugly get/put mismatch, while
of_fwnode_handle() can now abstract those open-coded dereferences.

Tested-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/0e2727adeb8cd73274425322f2f793561bdc927e.1719919669.git.robin.murphy@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/acpi/arm64/iort.c
drivers/acpi/scan.c
drivers/acpi/viot.c
drivers/iommu/arm/arm-smmu/arm-smmu.c
drivers/iommu/iommu-priv.h
drivers/iommu/iommu.c
drivers/iommu/mtk_iommu_v1.c
drivers/iommu/of_iommu.c
drivers/iommu/tegra-smmu.c
include/acpi/acpi_bus.h
include/linux/iommu.h