aboutsummaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2021-08-02 15:05:15 +0800
committerBin Meng <bmeng.cn@gmail.com>2021-08-03 00:03:14 +0800
commitc71d5fb717294ed9e46fc9a5855e8a1878b56f85 (patch)
tree52641d4d41924a59499b44c7c41a918fdebf5fac /arch/x86
parent33e4ab31a9647b0bacd44b579199eaae239d69e3 (diff)
downloadu-boot-c71d5fb717294ed9e46fc9a5855e8a1878b56f85.zip
u-boot-c71d5fb717294ed9e46fc9a5855e8a1878b56f85.tar.gz
u-boot-c71d5fb717294ed9e46fc9a5855e8a1878b56f85.tar.bz2
x86: queensbay: Return directly if IGD / SDVO were already disabled
Initialize 'igd' and 'sdvo' to NULL so that we just need to test them against NULL later, to be compatible with that case that IGD and SDVO devices were already in disabled state. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/cpu/queensbay/tnc.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/arch/x86/cpu/queensbay/tnc.c b/arch/x86/cpu/queensbay/tnc.c
index 782ed86..4a00862 100644
--- a/arch/x86/cpu/queensbay/tnc.c
+++ b/arch/x86/cpu/queensbay/tnc.c
@@ -18,19 +18,17 @@
static int __maybe_unused disable_igd(void)
{
- struct udevice *igd, *sdvo;
+ struct udevice *igd = NULL;
+ struct udevice *sdvo = NULL;
int ret;
- ret = dm_pci_bus_find_bdf(TNC_IGD, &igd);
- if (ret)
- return ret;
- if (!igd)
- return 0;
-
- ret = dm_pci_bus_find_bdf(TNC_SDVO, &sdvo);
- if (ret)
- return ret;
- if (!sdvo)
+ /*
+ * In case the IGD and SDVO devices were already in disabled state,
+ * we should return and not proceed any further.
+ */
+ dm_pci_bus_find_bdf(TNC_IGD, &igd);
+ dm_pci_bus_find_bdf(TNC_SDVO, &sdvo);
+ if (!igd || !sdvo)
return 0;
/*