]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / PciBusDxe / PciBus.c
index 3bb5099bd3fff4e390d5f4a1478c50dda8195c3e..9ae45cca9be926081a7de55f5b69748952c26410 100644 (file)
@@ -140,7 +140,7 @@ PciBusDriverBindingSupported (
   //\r
   if (RemainingDevicePath != NULL) {\r
     //\r
-    // Check if RemainingDevicePath is the End of Device Path Node, \r
+    // Check if RemainingDevicePath is the End of Device Path Node,\r
     // if yes, go on checking other conditions\r
     //\r
     if (!IsDevicePathEnd (RemainingDevicePath)) {\r
@@ -244,12 +244,17 @@ PciBusDriverBindingStart (
   EFI_DEVICE_PATH_PROTOCOL        *ParentDevicePath;\r
   EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo;\r
 \r
+  //\r
+  // Initialize PciRootBridgeIo to suppress incorrect compiler warning.\r
+  //\r
+  PciRootBridgeIo = NULL;\r
+\r
   //\r
   // Check RemainingDevicePath validation\r
   //\r
   if (RemainingDevicePath != NULL) {\r
     //\r
-    // Check if RemainingDevicePath is the End of Device Path Node, \r
+    // Check if RemainingDevicePath is the End of Device Path Node,\r
     // if yes, return EFI_SUCCESS\r
     //\r
     if (IsDevicePathEnd (RemainingDevicePath)) {\r
@@ -277,14 +282,14 @@ PciBusDriverBindingStart (
   //\r
   // If PCI Platform protocol doesn't exist, try to Pci Override Protocol.\r
   //\r
-  if (gPciPlatformProtocol == NULL) { \r
+  if (gPciPlatformProtocol == NULL) {\r
     gPciOverrideProtocol = NULL;\r
     gBS->LocateProtocol (\r
           &gEfiPciOverrideProtocolGuid,\r
           NULL,\r
           (VOID **) &gPciOverrideProtocol\r
           );\r
-  }  \r
+  }\r
 \r
   if (mIoMmuProtocol == NULL) {\r
     gBS->LocateProtocol (\r
@@ -310,7 +315,7 @@ PciBusDriverBindingStart (
                   This->DriverBindingHandle,\r
                   Controller,\r
                   EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );  \r
+                  );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   //\r
@@ -360,8 +365,19 @@ PciBusDriverBindingStart (
   //\r
   StartPciDevices (Controller);\r
 \r
-  gFullEnumeration = FALSE;\r
-  return EFI_SUCCESS;\r
+  if (gFullEnumeration) {\r
+    gFullEnumeration = FALSE;\r
+\r
+    Status = gBS->InstallProtocolInterface (\r
+                    &PciRootBridgeIo->ParentHandle,\r
+                    &gEfiPciEnumerationCompleteProtocolGuid,\r
+                    EFI_NATIVE_INTERFACE,\r
+                    NULL\r
+                    );\r
+    ASSERT_EFI_ERROR (Status);\r
+  }\r
+\r
+  return Status;\r
 }\r
 \r
 /**\r