]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c
Update all the code to consume the ConvertDevicePathToText, ConvertDevicePathNodeToTe...
[mirror_edk2.git] / OvmfPkg / Library / PlatformBdsLib / QemuBootOrder.c
index 9f94e2424a02b19267a0fb7d4070ad24b0720488..c9b8556fab0f28c8932ce78deaa3ce640b9e8225 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Rewrite the BootOrder NvVar based on QEMU's "bootorder" fw_cfg file.\r
 \r
-  Copyright (C) 2012, Red Hat, Inc.\r
+  Copyright (C) 2012 - 2013, Red Hat, Inc.\r
 \r
   This program and the accompanying materials are licensed and made available\r
   under the terms and conditions of the BSD License which accompanies this\r
@@ -20,7 +20,7 @@
 #include <Library/UefiRuntimeServicesTableLib.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/PrintLib.h>\r
-#include <Protocol/DevicePathToText.h>\r
+#include <Library/DevicePathLib.h>\r
 #include <Guid/GlobalVariable.h>\r
 \r
 \r
@@ -866,18 +866,17 @@ BOOLEAN
 Match (\r
   IN  CONST CHAR16                           *Translated,\r
   IN  UINTN                                  TranslatedLength,\r
-  IN  CONST EFI_DEVICE_PATH_PROTOCOL         *DevicePath,\r
-  IN  CONST EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText\r
+  IN  CONST EFI_DEVICE_PATH_PROTOCOL         *DevicePath\r
   )\r
 {\r
   CHAR16  *Converted;\r
   BOOLEAN Result;\r
 \r
-  Converted = DevPathToText->ConvertDevicePathToText (\r
-                               DevicePath,\r
-                               FALSE, // DisplayOnly\r
-                               FALSE  // AllowShortcuts\r
-                               );\r
+  Converted = ConvertDevicePathToText (\r
+                DevicePath,\r
+                FALSE, // DisplayOnly\r
+                FALSE  // AllowShortcuts\r
+                );\r
   if (Converted == NULL) {\r
     return FALSE;\r
   }\r
@@ -933,9 +932,6 @@ SetBootOrderFromQemu (
   )\r
 {\r
   RETURN_STATUS                    Status;\r
-\r
-  EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText;\r
-\r
   FIRMWARE_CONFIG_ITEM             FwCfgItem;\r
   UINTN                            FwCfgSize;\r
   CHAR8                            *FwCfg;\r
@@ -946,15 +942,6 @@ SetBootOrderFromQemu (
   UINTN                            TranslatedSize;\r
   CHAR16                           Translated[TRANSLATION_OUTPUT_SIZE];\r
 \r
-  Status = gBS->LocateProtocol (\r
-                  &gEfiDevicePathToTextProtocolGuid,\r
-                  NULL, // optional registration key\r
-                  (VOID **) &DevPathToText\r
-                  );\r
-  if (Status != EFI_SUCCESS) {\r
-    return Status;\r
-  }\r
-\r
   Status = QemuFwCfgFindFile ("bootorder", &FwCfgItem, &FwCfgSize);\r
   if (Status != RETURN_SUCCESS) {\r
     return Status;\r
@@ -1019,8 +1006,7 @@ SetBootOrderFromQemu (
             Match (\r
               Translated,\r
               TranslatedSize, // contains length, not size, in CHAR16's here\r
-              BootOption->DevicePath,\r
-              DevPathToText\r
+              BootOption->DevicePath\r
               )\r
             ) {\r
           //\r