diff options
author | Angel Pons <th3fanbus@gmail.com> | 2021-11-03 13:22:22 +0100 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-11-04 17:34:56 +0000 |
commit | e058841913f8374dfa511f56504e21659c46769e (patch) | |
tree | 99cfe3efb56245da8cfe0bb171ce6d2177e7fc12 /src/drivers/aspeed | |
parent | c1bfbe03a2d379d6859734da445a8ab3fd292305 (diff) |
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>
Diffstat (limited to 'src/drivers/aspeed')
-rw-r--r-- | src/drivers/aspeed/common/ast_mode_corebootfb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/drivers/aspeed/common/ast_mode_corebootfb.c b/src/drivers/aspeed/common/ast_mode_corebootfb.c index b25d742f01..6c63931f13 100644 --- a/src/drivers/aspeed/common/ast_mode_corebootfb.c +++ b/src/drivers/aspeed/common/ast_mode_corebootfb.c @@ -22,7 +22,7 @@ int ast_crtc_do_set_base(struct drm_crtc *crtc) struct drm_framebuffer *fb = crtc->primary->fb; /* PCI BAR 0 */ - struct resource *res = find_resource(crtc->dev->pdev, PCI_BASE_ADDRESS_0); + struct resource *res = probe_resource(crtc->dev->pdev, PCI_BASE_ADDRESS_0); if (!res) { printk(BIOS_ERR, "BAR0 resource not found.\n"); return -EIO; |