]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/PciBus: Remove unnecessary PCIE detection
authorRuiyu Ni <ruiyu.ni@intel.com>
Fri, 25 May 2018 09:47:43 +0000 (17:47 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Mon, 28 May 2018 08:33:54 +0000 (16:33 +0800)
CreatePciIoDevice() detects whether the PCI device is a PCI Express
device and remembers the device type in PciIoDevice->IsPciExp.

RegisterPciDevice() detects the device type again which is
unnecessary. The detection logic can be removed.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c

index e76c8f00468a87e9db7d6b014b3cffa257cd2a89..f69fe938da061263fb0fde7dce895d14d2afd450 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Supporting functions implementaion for PCI devices management.\r
 \r
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -211,7 +211,6 @@ RegisterPciDevice (
   EFI_STATUS          Status;\r
   VOID                *PlatformOpRomBuffer;\r
   UINTN               PlatformOpRomSize;\r
-  UINT8               PciExpressCapRegOffset;\r
   EFI_PCI_IO_PROTOCOL *PciIo;\r
   UINT8               Data8;\r
   BOOLEAN             HasEfiImage;\r
@@ -231,20 +230,6 @@ RegisterPciDevice (
     return Status;\r
   }\r
 \r
-  //\r
-  // Detect if PCI Express Device\r
-  //\r
-  PciExpressCapRegOffset = 0;\r
-  Status = LocateCapabilityRegBlock (\r
-             PciIoDevice,\r
-             EFI_PCI_CAPABILITY_ID_PCIEXP,\r
-             &PciExpressCapRegOffset,\r
-             NULL\r
-             );\r
-  if (!EFI_ERROR (Status)) {\r
-    PciIoDevice->IsPciExp = TRUE;\r
-  }\r
-\r
   //\r
   // Force Interrupt line to "Unknown" or "No Connection"\r
   //\r