diff options
author | Haojian Zhuang <haojian.zhuang@linaro.org> | 2018-02-10 14:55:20 +0800 |
---|---|---|
committer | Haojian Zhuang <haojian.zhuang@linaro.org> | 2018-02-10 15:01:27 +0800 |
commit | b195820461509b3d0ab04674a457a928bdc3a07c (patch) | |
tree | 5b42cd3f9955294f0a8a92fb1f56321fa6aa7330 | |
parent | 389915f98330682871811e5df84195effb55a8d3 (diff) | |
download | OpenPlatformPkg-b195820461509b3d0ab04674a457a928bdc3a07c.tar.gz |
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>
-rw-r--r-- | Platforms/Hisilicon/HiKey/HiKeyMmcDxe/HiKeyMmcDxe.c | 8 |
1 files changed, 4 insertions, 4 deletions
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 @@ HiKeyGetCapability ( BOOLEAN EFIAPI HiKeyCardDetect ( + IN EFI_HANDLE Controller, IN UINT8 Slot ) { @@ -86,9 +87,9 @@ HiKeyCardDetect ( 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 @@ HiKeyCardDetect ( return TRUE; } return FALSE; - } else { - return FALSE; } + return FALSE; } PLATFORM_DW_MMC_PROTOCOL mDwMmcDevice = { |