Attention is currently required from: Lance Zhao, Tim Wawrzynczak, Werner Zeh. Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/58910 )
Change subject: treewide: Replace bad uses of `find_resource` ......................................................................
treewide: 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: I329efcb42a444b097794fde4f40acf5ececaea8c Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/acpi/acpi.c M src/device/azalia_device.c M src/mainboard/siemens/mc_apl1/mainboard.c 3 files changed, 3 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/58910/1
diff --git a/src/acpi/acpi.c b/src/acpi/acpi.c index 282d734..60f8c21 100644 --- a/src/acpi/acpi.c +++ b/src/acpi/acpi.c @@ -1248,7 +1248,7 @@ printk(BIOS_INFO, "%s: Device not enabled\n", __func__); return current; } - res = find_resource(dev, PCI_BASE_ADDRESS_0); + res = probe_resource(dev, PCI_BASE_ADDRESS_0); if (!res) { printk(BIOS_ERR, "%s: Unable to find resource for %s\n", __func__, dev_path(dev)); diff --git a/src/device/azalia_device.c b/src/device/azalia_device.c index 70f8348..a223e76 100644 --- a/src/device/azalia_device.c +++ b/src/device/azalia_device.c @@ -285,7 +285,7 @@ struct resource *res; u16 codec_mask;
- res = find_resource(dev, PCI_BASE_ADDRESS_0); + res = probe_resource(dev, PCI_BASE_ADDRESS_0); if (!res) return;
diff --git a/src/mainboard/siemens/mc_apl1/mainboard.c b/src/mainboard/siemens/mc_apl1/mainboard.c index 7ac8764..24e61dc 100644 --- a/src/mainboard/siemens/mc_apl1/mainboard.c +++ b/src/mainboard/siemens/mc_apl1/mainboard.c @@ -229,7 +229,7 @@ dev = pcidev_path_on_root(PCH_DEVFN_SDCARD); if (dev) { uint32_t reg; - struct resource *res = find_resource(dev, PCI_BASE_ADDRESS_0); + struct resource *res = probe_resource(dev, PCI_BASE_ADDRESS_0); if (!res) return;