]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c
Update all the code to consume the ConvertDevicePathToText, ConvertDevicePathNodeToTe...
[mirror_edk2.git] / MdeModulePkg / Universal / PlatformDriOverrideDxe / PlatDriOverrideDxe.c
index 9c0064df2935700de2dc934c0581e533ff241167..ab254a0b450e1eb4d558c427ff7a0bafdf4fcdba 100644 (file)
@@ -13,7 +13,7 @@
   4. It save all the mapping info in NV variables which will be consumed\r
      by platform override protocol driver to publish the platform override protocol.\r
 \r
-Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2013, 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
@@ -104,45 +104,29 @@ HII_VENDOR_DEVICE_PATH  mHiiVendorDevicePath = {
 };\r
 \r
 /**\r
-  Converting a given device to an unicode string. \r
-  \r
-  This function will dependent on gEfiDevicePathToTextProtocolGuid, if protocol\r
-  does not installed, then return unknown device path L"?" directly.\r
-  \r
+  Converting a given device to an unicode string.\r
+\r
   @param    DevPath     Given device path instance\r
   \r
   @return   Converted string from given device path.\r
-  @retval   L"?"  Can not locate gEfiDevicePathToTextProtocolGuid protocol for converting.\r
+  @retval   L"?" Converting failed.\r
 **/\r
 CHAR16 *\r
 DevicePathToStr (\r
   IN EFI_DEVICE_PATH_PROTOCOL     *DevPath\r
   )\r
 {\r
-  EFI_STATUS                       Status;\r
-  EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText;\r
-  CHAR16                           *ToText;\r
-  \r
-  if (DevPath == NULL) {\r
-    return L"";\r
-  }\r
-    \r
-  Status = gBS->LocateProtocol (\r
-                  &gEfiDevicePathToTextProtocolGuid,\r
-                  NULL,\r
-                  (VOID **) &DevPathToText\r
-                  );\r
-  if (!EFI_ERROR (Status)) {\r
-    ToText = DevPathToText->ConvertDevicePathToText (\r
-                              DevPath,\r
-                              FALSE,\r
-                              TRUE\r
-                              );\r
-    ASSERT (ToText != NULL);\r
-    return ToText;\r
+  CHAR16                          *Text;\r
+  Text = ConvertDevicePathToText (\r
+           DevPath,\r
+           FALSE,\r
+           TRUE\r
+           );\r
+  if (Text == NULL) {\r
+    return AllocateCopyPool (sizeof (L"?"), L"?");\r
+  } else {\r
+    return Text;\r
   }\r
-\r
-  return L"?";\r
 }\r
 \r
 /**\r