soc/intel: Replace bad uses of `find_resource`
The `find_resource` function will never return null (will die instead).
In cases where the existing code already accounts for null pointers, it
is better to use `probe_resource` instead, which returns a null pointer
instead of dying.
Change-Id: I2a57ea1c2f5b156afd0724829e5b1880246f351f
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58907
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
diff --git a/src/soc/intel/braswell/lpss.c b/src/soc/intel/braswell/lpss.c
index 93ee3da..5f93e17 100644
--- a/src/soc/intel/braswell/lpss.c
+++ b/src/soc/intel/braswell/lpss.c
@@ -31,11 +31,11 @@
struct device_nvs *dev_nvs = acpi_get_device_nvs();
/* Save BAR0 and BAR1 to ACPI NVS */
- bar = find_resource(dev, PCI_BASE_ADDRESS_0);
+ bar = probe_resource(dev, PCI_BASE_ADDRESS_0);
if (bar)
dev_nvs->lpss_bar0[nvs_index] = (u32)bar->base;
- bar = find_resource(dev, PCI_BASE_ADDRESS_1);
+ bar = probe_resource(dev, PCI_BASE_ADDRESS_1);
if (bar)
dev_nvs->lpss_bar1[nvs_index] = (u32)bar->base;