]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OptionRomPkg/CirrusLogic5430Dxe/ComponentName.c
ArmVirtPkg: ArmVirtPlatformLib: find the lowest memory node
[mirror_edk2.git] / OptionRomPkg / CirrusLogic5430Dxe / ComponentName.c
index 8fddfc5f76b0d5139538ccc0b74f34b4777f5bdb..e935bd76370710c730546da16e70185b23e07865 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
-  Copyright (c) 2006, Intel Corporation                                                         \r
-  All rights reserved. This program and the accompanying materials                          \r
+  Copyright (c) 2006 - 2011, 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
   http://opensource.org/licenses/bsd-license.php                                            \r
@@ -61,7 +61,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mCirrusLogic5430Controlle
                                 languages specified in SupportedLanguages. The\r
                                 number of languages supported by a driver is up\r
                                 to the driver writer. Language is specified\r
-                                in RFC 3066 or ISO 639-2 language code format.\r
+                                in RFC 4646 or ISO 639-2 language code format.\r
 \r
   @param  DriverName[out]       A pointer to the Unicode string to return.\r
                                 This Unicode string is the name of the\r
@@ -134,7 +134,7 @@ CirrusLogic5430ComponentNameGetDriverName (
                                 languages specified in SupportedLanguages. The\r
                                 number of languages supported by a driver is up\r
                                 to the driver writer. Language is specified in\r
-                                RFC 3066 or ISO 639-2 language code format.\r
+                                RFC 4646 or ISO 639-2 language code format.\r
 \r
   @param  ControllerName[out]   A pointer to the Unicode string to return.\r
                                 This Unicode string is the name of the\r
@@ -148,7 +148,7 @@ CirrusLogic5430ComponentNameGetDriverName (
                                 driver specified by This was returned in\r
                                 DriverName.\r
 \r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
 \r
   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
                                 EFI_HANDLE.\r
@@ -175,9 +175,7 @@ CirrusLogic5430ComponentNameGetControllerName (
   OUT CHAR16                                          **ControllerName\r
   )\r
 {\r
-  EFI_UGA_DRAW_PROTOCOL           *UgaDraw;\r
   EFI_STATUS                      Status;\r
-  EFI_PCI_IO_PROTOCOL             *PciIoProtocol;\r
 \r
   //\r
   // This is a device driver, so ChildHandle must be NULL.\r
@@ -187,42 +185,13 @@ CirrusLogic5430ComponentNameGetControllerName (
   }\r
 \r
   //\r
-  // Check Controller's handle\r
+  // Make sure this driver is currently managing ControllHandle\r
   //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiPciIoProtocolGuid,\r
-                  (VOID **) &PciIoProtocol,\r
-                  gCirrusLogic5430DriverBinding.DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-  if (!EFI_ERROR (Status)) {\r
-    gBS->CloseProtocol (\r
-          ControllerHandle,\r
-          &gEfiPciIoProtocolGuid,\r
-          gCirrusLogic5430DriverBinding.DriverBindingHandle,\r
-          ControllerHandle\r
-          );\r
-\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  if (Status != EFI_ALREADY_STARTED) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Get the UGA Draw Protocol on Controller\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiUgaDrawProtocolGuid,\r
-                  (VOID **) &UgaDraw,\r
-                  gCirrusLogic5430DriverBinding.DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
+  Status = EfiTestManagedDevice (\r
+             ControllerHandle,\r
+             gCirrusLogic5430DriverBinding.DriverBindingHandle,\r
+             &gEfiPciIoProtocolGuid\r
+             );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r