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
};\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