diff options
author | Angel Pons <th3fanbus@gmail.com> | 2021-11-03 13:07:14 +0100 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-11-04 17:32:06 +0000 |
commit | f32ae10f0d62e646cc196f8eb2bb841f60cbe9d6 (patch) | |
tree | a5dda13e1c8cd0a3e176f08e03c4c403ba7f3f25 /src/southbridge/intel/lynxpoint/serialio.c | |
parent | 5065ad1f6980663a2399b06a6a29a1312d7e46e2 (diff) |
sb/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: I13c7ebeba2e5a896d46231b5e176e5470da97343
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58905
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Diffstat (limited to 'src/southbridge/intel/lynxpoint/serialio.c')
-rw-r--r-- | src/southbridge/intel/lynxpoint/serialio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/southbridge/intel/lynxpoint/serialio.c b/src/southbridge/intel/lynxpoint/serialio.c index 34f8c78c6d..0aa683d633 100644 --- a/src/southbridge/intel/lynxpoint/serialio.c +++ b/src/southbridge/intel/lynxpoint/serialio.c @@ -166,10 +166,10 @@ static void serialio_init(struct device *dev) pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY); /* Find BAR0 and BAR1 */ - bar0 = find_resource(dev, PCI_BASE_ADDRESS_0); + bar0 = probe_resource(dev, PCI_BASE_ADDRESS_0); if (!bar0) return; - bar1 = find_resource(dev, PCI_BASE_ADDRESS_1); + bar1 = probe_resource(dev, PCI_BASE_ADDRESS_1); if (!bar1) return; |