summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaleb Connolly <caleb.connolly@linaro.org>2023-12-11 18:41:40 +0000
committerTom Rini <trini@konsulko.com>2023-12-21 11:59:49 -0500
commite96ecbe71925f31ee43d353ceabe5b2c53df512f (patch)
tree9b3b3ba0624be05c4f5569022c52823f1c1aa545
parentf1b809c55c2762ab3bb47b3b11d769c04f46093a (diff)
iommu: fix compilation when CONFIG_PCI disabled
The dev_pci_iommu_enable() function is only available when CONFIG_PCI is enabled, replace the runtime check with a preprocessor one to fix compilation with pci disabled. Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
-rw-r--r--drivers/iommu/iommu-uclass.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/iommu/iommu-uclass.c b/drivers/iommu/iommu-uclass.c
index 72f123df55a..98731d5e2c4 100644
--- a/drivers/iommu/iommu-uclass.c
+++ b/drivers/iommu/iommu-uclass.c
@@ -100,9 +100,10 @@ int dev_iommu_enable(struct udevice *dev)
dev->iommu = dev_iommu;
}
- if (CONFIG_IS_ENABLED(PCI) && count < 0 &&
- device_is_on_pci_bus(dev))
+#if CONFIG_IS_ENABLED(PCI)
+ if (count < 0 && device_is_on_pci_bus(dev))
return dev_pci_iommu_enable(dev);
+#endif
return 0;
}