HiKey/HiKeyMmcDxe: fix on detecting SD card
Since eMMC and SD controllers are handled as two controllers,
slot can't be used to distinguish these two devices.
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
diff --git a/Platforms/Hisilicon/HiKey/HiKeyMmcDxe/HiKeyMmcDxe.c b/Platforms/Hisilicon/HiKey/HiKeyMmcDxe/HiKeyMmcDxe.c
index 0f58697..e7d3c6c 100644
--- a/Platforms/Hisilicon/HiKey/HiKeyMmcDxe/HiKeyMmcDxe.c
+++ b/Platforms/Hisilicon/HiKey/HiKeyMmcDxe/HiKeyMmcDxe.c
@@ -79,6 +79,7 @@
BOOLEAN
EFIAPI
HiKeyCardDetect (
+ IN EFI_HANDLE Controller,
IN UINT8 Slot
)
{
@@ -86,9 +87,9 @@
EMBEDDED_GPIO *Gpio;
UINTN Value;
- if (Slot == 0) {
+ if (DwMmcCapability[0].Controller == Controller) {
return TRUE;
- } else if (Slot == 1) {
+ } else if (DwMmcCapability[1].Controller == Controller) {
Status = gBS->LocateProtocol (&gEmbeddedGpioProtocolGuid, NULL, (VOID **)&Gpio);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "Failed to get GPIO protocol: %r\n", Status));
@@ -108,9 +109,8 @@
return TRUE;
}
return FALSE;
- } else {
- return FALSE;
}
+ return FALSE;
}
PLATFORM_DW_MMC_PROTOCOL mDwMmcDevice = {