\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
// 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
UINT16 Data;\r
UINT32 PresentState;\r
\r
+ //\r
+ // Check Present State Register to see if there is a card presented.\r
+ //\r
+ Status = SdMmcHcRwMmio (PciIo, Slot, SD_MMC_HC_PRESENT_STATE, TRUE, sizeof (PresentState), &PresentState);\r
+ if (EFI_ERROR (Status)) {\r
+ return Status;\r
+ }\r
+\r
+ if ((PresentState & BIT16) != 0) {\r
+ *MediaPresent = TRUE;\r
+ } else {\r
+ *MediaPresent = FALSE;\r
+ }\r
+\r
//\r
// Check Normal Interrupt Status Register\r
//\r
return Status;\r
}\r
\r
- //\r
- // Check Present State Register to see if there is a card presented.\r
- //\r
- Status = SdMmcHcRwMmio (PciIo, Slot, SD_MMC_HC_PRESENT_STATE, TRUE, sizeof (PresentState), &PresentState);\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
- if ((PresentState & BIT16) != 0) {\r
- *MediaPresent = TRUE;\r
- } else {\r
- *MediaPresent = FALSE;\r
- }\r
return EFI_MEDIA_CHANGED;\r
}\r
\r