This can fail for internal reasons, so return a sensible value rather than
a random one.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
- pci_hose_read_config_byte(get_hose(), dev, where, &value);
+ if (pci_hose_read_config_byte(get_hose(), dev, where, &value))
+ return -1U;
- pci_hose_read_config_word(get_hose(), dev, where, &value);
+ if (pci_hose_read_config_word(get_hose(), dev, where, &value))
+ return -1U;
- pci_hose_read_config_dword(get_hose(), dev, where, &value);
+ if (pci_hose_read_config_dword(get_hose(), dev, where, &value))
+ return -1U;