]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Nt32Pkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c
Use apply PeiServicesLib to locate PPI
[mirror_edk2.git] / Nt32Pkg / MiscSubClassPlatformDxe / MiscSubclassDriverEntryPoint.c
index 138ed7f439acef4d72e7ab5dce1b9d2dea8f8077..43846977571a6d89d331a5436ecdc9ff9e6626e3 100644 (file)
@@ -1,4 +1,4 @@
-/*++\r
+/**@file\r
 \r
 Copyright (c) 2006 - 2007, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -18,7 +18,7 @@ Abstract:
   This driver parses the mMiscSubclassDataTable structure and reports\r
   any generated data to the DataHub.\r
 \r
---*/\r
+**/\r
 \r
 #include "MiscSubclassDriver.h"\r
 \r
@@ -148,8 +148,6 @@ Returns:
 {\r
   EFI_MISC_SUBCLASS_DRIVER_DATA     RecordData;\r
   EFI_DATA_HUB_PROTOCOL             *DataHub;\r
-  EFI_HII_PROTOCOL                  *Hii;\r
-  EFI_HII_PACKAGES                  *PackageList;\r
   EFI_HII_HANDLE                    HiiHandle;\r
   EFI_STATUS                        Status;\r
   UINTN                             Index;\r
@@ -170,7 +168,7 @@ Returns:
   //\r
   // Locate data hub protocol.\r
   //\r
-  Status = gBS->LocateProtocol (&gEfiDataHubProtocolGuid, NULL, &DataHub);\r
+  Status = gBS->LocateProtocol (&gEfiDataHubProtocolGuid, NULL, (VOID**)&DataHub);\r
 \r
   if (EFI_ERROR (Status)) {\r
     DEBUG ((EFI_D_ERROR, "Could not locate DataHub protocol.  %r\n", Status));\r
@@ -180,23 +178,9 @@ Returns:
     return EFI_DEVICE_ERROR;\r
   }\r
   //\r
-  // Locate hii protocol.\r
-  //\r
-  Status = gBS->LocateProtocol (&gEfiHiiProtocolGuid, NULL, &Hii);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    DEBUG ((EFI_D_ERROR, "Could not locate Hii protocol.  %r\n", Status));\r
-    return Status;\r
-  } else if (Hii == NULL) {\r
-    DEBUG ((EFI_D_ERROR, "LocateProtocol(Hii) returned NULL pointer!\n"));\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
-  //\r
   // Add our default strings to the HII database. They will be modified later.\r
   //\r
-  PackageList = PreparePackages (1, &gEfiMiscSubClassGuid, MiscSubclassStrings);\r
-  Status   = Hii->NewPack (Hii, PackageList, &HiiHandle);\r
-  FreePool (PackageList);\r
+  HiiLibAddPackages (1, &gEfiMiscSubClassGuid, NULL, &HiiHandle, MiscSubclassStrings);\r
 \r
   if (EFI_ERROR (Status)) {\r
     DEBUG ((EFI_D_ERROR, "Could not log default strings to Hii.  %r\n", Status));\r