]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c
MdeModulePkg/Sd: update the sd detection logic
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / SdMmcPciHcDxe / SdMmcPciHcDxe.c
index 0a2f034cfca1c32a5790286c8dcfabe6dfac2eb5..59649e1cad4d4864d625bc43df2de01bd2309c5a 100644 (file)
@@ -4,7 +4,7 @@
 \r
   It would expose EFI_SD_MMC_PASS_THRU_PROTOCOL for upper layer use.\r
 \r
-  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2015 - 2016, 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
@@ -613,7 +613,9 @@ SdMmcPciHcDriverBindingStart (
     // Check whether there is a SD/MMC card attached\r
     //\r
     Status = SdMmcHcCardDetect (PciIo, Slot, &MediaPresent);\r
-    if ((Status == EFI_MEDIA_CHANGED) && (MediaPresent == FALSE)) {\r
+    if (EFI_ERROR (Status) && (Status != EFI_MEDIA_CHANGED)) {\r
+      continue;\r
+    } else if (MediaPresent == FALSE) {\r
       DEBUG ((EFI_D_ERROR, "SdMmcHcCardDetect: No device attached in Slot[%d]!!!\n", Slot));\r
       continue;\r
     }\r