From: Caleb Connolly Date: Mon, 11 Dec 2023 18:41:40 +0000 (+0000) Subject: iommu: fix compilation when CONFIG_PCI disabled X-Git-Url: http://git.dujemihanovic.xyz/html/index.html?a=commitdiff_plain;h=e96ecbe71925f31ee43d353ceabe5b2c53df512f;p=u-boot.git 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 --- diff --git a/drivers/iommu/iommu-uclass.c b/drivers/iommu/iommu-uclass.c index 72f123df55..98731d5e2c 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; }