This function calls dm_pci_read_bar32() which is only available if PCI
is enabled. Add this condition here too, so that the EFI app can build
without needing --gc-sections

Signed-off-by: Simon Glass <s...@chromium.org>
Reviewed-by: Matthias Brugger <mbrug...@suse.com>
Reviewed-by: Tom Rini <tr...@konsulko.com>
---

(no changes since v1)

 lib/fdtdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 3b4247be25a..0244e8a3a72 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -248,6 +248,7 @@ int fdtdec_get_pci_vendev(const void *blob, int node, u16 
*vendor, u16 *device)
        return -ENOENT;
 }
 
+#ifdef CONFIG_PCI
 int fdtdec_get_pci_bar32(const struct udevice *dev, struct fdt_pci_addr *addr,
                         u32 *bar)
 {
@@ -264,6 +265,7 @@ int fdtdec_get_pci_bar32(const struct udevice *dev, struct 
fdt_pci_addr *addr,
 
        return 0;
 }
+#endif
 
 int fdtdec_get_pci_bus_range(const void *blob, int node,
                             struct fdt_resource *res)
-- 
2.43.0

Reply via email to