]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiDpLib/DpUtilities.c
Update all the code to consume the ConvertDevicePathToText, ConvertDevicePathNodeToTe...
[mirror_edk2.git] / ShellPkg / Library / UefiDpLib / DpUtilities.c
index 89c9919e037a4ed7944a2f967fe08f465c35b10d..57c81288da875d7406e2ebf2f8d0812863be611f 100644 (file)
@@ -31,7 +31,6 @@
 #include <Protocol/DriverBinding.h>\r
 #include <Protocol/ComponentName2.h>\r
 #include <Protocol/DevicePath.h>\r
-#include <Protocol/DevicePathToText.h>\r
 \r
 #include <Guid/Performance.h>\r
 \r
@@ -204,7 +203,6 @@ GetNameFromHandle (
   UINTN                       StringSize;\r
   CHAR8                       *PlatformLanguage;\r
   EFI_COMPONENT_NAME2_PROTOCOL      *ComponentName2;\r
-  EFI_DEVICE_PATH_TO_TEXT_PROTOCOL  *DevicePathToText;\r
 \r
   //\r
   // Method 1: Get the name string from image PDB\r
@@ -320,19 +318,12 @@ GetNameFromHandle (
       //\r
       // Method 5: Get the name string from image DevicePath\r
       //\r
-      Status = gBS->LocateProtocol (\r
-                      &gEfiDevicePathToTextProtocolGuid,\r
-                      NULL,\r
-                      (VOID **) &DevicePathToText\r
-                      );\r
-      if (!EFI_ERROR (Status)) {\r
-        NameString = DevicePathToText->ConvertDevicePathToText (LoadedImageDevicePath, TRUE, FALSE);\r
-        if (NameString != NULL) {\r
-          StrnCpy (mGaugeString, NameString, DP_GAUGE_STRING_LENGTH);\r
-          mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;\r
-          FreePool (NameString);\r
-          return;\r
-        }\r
+      NameString = ConvertDevicePathToText (LoadedImageDevicePath, TRUE, FALSE);\r
+      if (NameString != NULL) {\r
+        StrnCpy (mGaugeString, NameString, DP_GAUGE_STRING_LENGTH);\r
+        mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;\r
+        FreePool (NameString);\r
+        return;\r
       }\r
     }\r
   }\r