From e058841913f8374dfa511f56504e21659c46769e Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Wed, 3 Nov 2021 13:22:22 +0100 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/58908 Tested-by: build bot (Jenkins) Reviewed-by: Werner Zeh Reviewed-by: Tim Wawrzynczak --- src/drivers/usb/pci_ehci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/drivers/usb/pci_ehci.c') diff --git a/src/drivers/usb/pci_ehci.c b/src/drivers/usb/pci_ehci.c index d59ca32504..8e854264a2 100644 --- a/src/drivers/usb/pci_ehci.c +++ b/src/drivers/usb/pci_ehci.c @@ -75,7 +75,7 @@ static void pci_ehci_set_resources(struct device *dev) if (ehci_drv_ops->set_resources) ehci_drv_ops->set_resources(dev); - res = find_resource(dev, EHCI_BAR_INDEX); + res = probe_resource(dev, EHCI_BAR_INDEX); if (!res) return; -- cgit v1.2.3