diff options
author | Angel Pons <th3fanbus@gmail.com> | 2021-11-03 13:25:02 +0100 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-11-04 17:36:32 +0000 |
commit | c167b748686529fa9f9c667f57cba6519220b341 (patch) | |
tree | 6b00bafa689344290da8875b42b50501469044e4 /src/superio/fintek | |
parent | e058841913f8374dfa511f56504e21659c46769e (diff) |
superio: 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: Ic6e28add78f686fc9ab4556eddbedf7828fba9ef
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58909
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Diffstat (limited to 'src/superio/fintek')
-rw-r--r-- | src/superio/fintek/f71808a/f71808a_hwm.c | 2 | ||||
-rw-r--r-- | src/superio/fintek/f71869ad/f71869ad_hwm.c | 2 | ||||
-rw-r--r-- | src/superio/fintek/f81866d/f81866d_hwm.c | 2 | ||||
-rw-r--r-- | src/superio/fintek/f81866d/f81866d_uart.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/superio/fintek/f71808a/f71808a_hwm.c b/src/superio/fintek/f71808a/f71808a_hwm.c index 340bc30d4d..f8c4472ce8 100644 --- a/src/superio/fintek/f71808a/f71808a_hwm.c +++ b/src/superio/fintek/f71808a/f71808a_hwm.c @@ -35,7 +35,7 @@ void f71808a_hwm_init(struct device *dev) { - struct resource *res = find_resource(dev, PNP_IDX_IO0); + struct resource *res = probe_resource(dev, PNP_IDX_IO0); if (!res) { printk(BIOS_WARNING, "Super I/O HWM: No HWM resource found.\n"); diff --git a/src/superio/fintek/f71869ad/f71869ad_hwm.c b/src/superio/fintek/f71869ad/f71869ad_hwm.c index 6333ae160a..9add2a779e 100644 --- a/src/superio/fintek/f71869ad/f71869ad_hwm.c +++ b/src/superio/fintek/f71869ad/f71869ad_hwm.c @@ -41,7 +41,7 @@ void f71869ad_hwm_init(struct device *dev) { const struct superio_fintek_f71869ad_config *conf = dev->chip_info; - struct resource *res = find_resource(dev, PNP_IDX_IO0); + struct resource *res = probe_resource(dev, PNP_IDX_IO0); if (!res) { printk(BIOS_WARNING, "Super I/O HWM: No HWM resource found.\n"); diff --git a/src/superio/fintek/f81866d/f81866d_hwm.c b/src/superio/fintek/f81866d/f81866d_hwm.c index a7ed96bb26..a82adb3472 100644 --- a/src/superio/fintek/f81866d/f81866d_hwm.c +++ b/src/superio/fintek/f81866d/f81866d_hwm.c @@ -38,7 +38,7 @@ void f81866d_hwm_init(struct device *dev) { - struct resource *res = find_resource(dev, PNP_IDX_IO0); + struct resource *res = probe_resource(dev, PNP_IDX_IO0); if (!res) { printk(BIOS_WARNING, "Super I/O HWM: No HWM resource found.\n"); diff --git a/src/superio/fintek/f81866d/f81866d_uart.c b/src/superio/fintek/f81866d/f81866d_uart.c index 7d98a7fd2f..f6ebbfcac8 100644 --- a/src/superio/fintek/f81866d/f81866d_uart.c +++ b/src/superio/fintek/f81866d/f81866d_uart.c @@ -19,7 +19,7 @@ */ void f81866d_uart_init(struct device *dev) { - struct resource *res = find_resource(dev, PNP_IDX_IO0); + struct resource *res = probe_resource(dev, PNP_IDX_IO0); u8 tmp; if (!res) { |