coreboot/src/commonlib/storage
Subrata Banik cab89f7d11 commonlib/storage: Avoid build error when CONFIG_PCI is disabled
When CONFIG_PCI is disabled, but COMMONLIB_STORAGE and
COMMONLIB_STORAGE_SD are enabled, the compilation of
pci_sdhci.c fails. This is because the code attempts to use
pci_s_read_config32() with the PCI_BASE_ADDRESS_0 macro, which
are only defined when CONFIG_PCI is enabled.

Add an early return NULL check based on !CONFIG(PCI) at the
beginning of new_pci_sdhci_controller(). This prevents the
compiler from attempting to process the PCI-specific code path
when PCI support is not configured, resolving the build failure
in this specific Kconfig scenario.

TEST=Able to build herobrine.

Change-Id: I5c70d9b9ebcac13b47bba2c260fdf2ad7d56d4d7
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/87092
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
2025-04-03 03:11:05 +00:00
..
bouncebuf.c treewide: Move stdlib.h to commonlib 2024-03-15 10:09:43 +00:00
bouncebuf.h src/commonlib: Remove unnecessary space after casts 2022-11-22 13:47:15 +00:00
Kconfig src: Remove leading blank lines from SPDX header 2020-05-18 07:00:27 +00:00
Makefile.mk acpi,arch,commonlib: Rename Makefiles from .inc to .mk 2024-01-24 08:32:11 +00:00
mmc.c commonlib: Remove blank lines before '}' and after '{' 2024-03-30 07:48:23 +00:00
mmc.h treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
pci_sdhci.c commonlib/storage: Avoid build error when CONFIG_PCI is disabled 2025-04-03 03:11:05 +00:00
sd.c src/commonlib: Drop unneeded empty lines 2020-09-21 15:53:25 +00:00
sd_mmc.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
sd_mmc.h commonlib/storage: Add common eMMC functions 2023-01-16 00:33:11 +00:00
sdhci.c treewide: Move stdlib.h to commonlib 2024-03-15 10:09:43 +00:00
sdhci.h treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
sdhci_adma.c src/commonlib: Remove unnecessary space after casts 2022-11-22 13:47:15 +00:00
sdhci_display.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
storage.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
storage.h src/commonlib: Remove unnecessary space after casts 2022-11-22 13:47:15 +00:00
storage_erase.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
storage_write.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00