drivers: 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: Ia9a4b62c857f7362d67aee4f9de3bb2da1838394
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58908
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/drivers/net/atl1e.c b/src/drivers/net/atl1e.c
index 97ad140..d5e0cdd 100644
--- a/src/drivers/net/atl1e.c
+++ b/src/drivers/net/atl1e.c
@@ -106,7 +106,7 @@
static void atl1e_init(struct device *dev)
{
/* Get the resource of the NIC mmio */
- struct resource *nic_res = find_resource(dev, PCI_BASE_ADDRESS_0);
+ struct resource *nic_res = probe_resource(dev, PCI_BASE_ADDRESS_0);
if (nic_res == NULL) {
printk(BIOS_ERR, "atl1e: resource not found\n");