summaryrefslogtreecommitdiff
path: root/src/soc/intel/denverton_ns
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2021-11-03 13:18:53 +0100
committerFelix Held <felix-coreboot@felixheld.de>2021-11-04 17:34:30 +0000
commitc1bfbe03a2d379d6859734da445a8ab3fd292305 (patch)
treec06cef86fb068c718e7a4b60ef5620e46a31fdd8 /src/soc/intel/denverton_ns
parent536d36a7480c70acefb45c7f31db29489f4776e8 (diff)
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>
Diffstat (limited to 'src/soc/intel/denverton_ns')
-rw-r--r--src/soc/intel/denverton_ns/uart.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/soc/intel/denverton_ns/uart.c b/src/soc/intel/denverton_ns/uart.c
index 8084d26f6b..9d72642fb4 100644
--- a/src/soc/intel/denverton_ns/uart.c
+++ b/src/soc/intel/denverton_ns/uart.c
@@ -22,13 +22,13 @@ static void dnv_ns_uart_read_resources(struct device *dev)
pci_dev_read_resources(dev);
if (!CONFIG(LEGACY_UART_MODE))
return;
- struct resource *res = find_resource(dev, PCI_BASE_ADDRESS_0);
+ struct resource *res = probe_resource(dev, PCI_BASE_ADDRESS_0);
if (res == NULL)
return;
res->size = 0x8;
res->flags = IORESOURCE_IO | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
/* Do not configure membar */
- res = find_resource(dev, PCI_BASE_ADDRESS_1);
+ res = probe_resource(dev, PCI_BASE_ADDRESS_1);
if (res != NULL)
res->flags = 0;
compact_resources(dev);