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;
/*