From: Ruiyu Ni Date: Fri, 25 May 2018 09:47:43 +0000 (+0800) Subject: MdeModulePkg/PciBus: Remove unnecessary PCIE detection X-Git-Tag: edk2-stable201903~1668 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=2b5f0daa6c5f1d205b82c52c9ce55307a1787a3e MdeModulePkg/PciBus: Remove unnecessary PCIE detection 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 Reviewed-by: Star Zeng Cc: Hao A Wu --- diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c index e76c8f0046..f69fe938da 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c @@ -1,7 +1,7 @@ /** @file Supporting functions implementaion for PCI devices management. -Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -211,7 +211,6 @@ RegisterPciDevice ( EFI_STATUS Status; VOID *PlatformOpRomBuffer; UINTN PlatformOpRomSize; - UINT8 PciExpressCapRegOffset; EFI_PCI_IO_PROTOCOL *PciIo; UINT8 Data8; BOOLEAN HasEfiImage; @@ -231,20 +230,6 @@ RegisterPciDevice ( return Status; } - // - // Detect if PCI Express Device - // - PciExpressCapRegOffset = 0; - Status = LocateCapabilityRegBlock ( - PciIoDevice, - EFI_PCI_CAPABILITY_ID_PCIEXP, - &PciExpressCapRegOffset, - NULL - ); - if (!EFI_ERROR (Status)) { - PciIoDevice->IsPciExp = TRUE; - } - // // Force Interrupt line to "Unknown" or "No Connection" //