summaryrefslogtreecommitdiff
path: root/OptionRomPkg
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2007-11-23 06:10:27 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2007-11-23 06:10:27 +0000
commit54857d5a7c45ff7abd4b6406235dcbd5c132f57c (patch)
tree7bc45b796b4cb0ddbd2be529157dc040d8819910 /OptionRomPkg
parent87f8ccbe19e09b6ece2c72bb70add08d0cc627f7 (diff)
downloadedk2-platforms-54857d5a7c45ff7abd4b6406235dcbd5c132f57c.tar.xz
Apply library to test controller handle.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4323 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OptionRomPkg')
-rw-r--r--OptionRomPkg/CirrusLogic5430Dxe/ComponentName.c43
1 files changed, 6 insertions, 37 deletions
diff --git a/OptionRomPkg/CirrusLogic5430Dxe/ComponentName.c b/OptionRomPkg/CirrusLogic5430Dxe/ComponentName.c
index 8fddfc5f76..1a98b3788c 100644
--- a/OptionRomPkg/CirrusLogic5430Dxe/ComponentName.c
+++ b/OptionRomPkg/CirrusLogic5430Dxe/ComponentName.c
@@ -175,9 +175,7 @@ CirrusLogic5430ComponentNameGetControllerName (
OUT CHAR16 **ControllerName
)
{
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
EFI_STATUS Status;
- EFI_PCI_IO_PROTOCOL *PciIoProtocol;
//
// This is a device driver, so ChildHandle must be NULL.
@@ -187,42 +185,13 @@ CirrusLogic5430ComponentNameGetControllerName (
}
//
- // Check Controller's handle
+ // Make sure this driver is currently managing ControllHandle
//
- Status = gBS->OpenProtocol (
- ControllerHandle,
- &gEfiPciIoProtocolGuid,
- (VOID **) &PciIoProtocol,
- gCirrusLogic5430DriverBinding.DriverBindingHandle,
- ControllerHandle,
- EFI_OPEN_PROTOCOL_BY_DRIVER
- );
- if (!EFI_ERROR (Status)) {
- gBS->CloseProtocol (
- ControllerHandle,
- &gEfiPciIoProtocolGuid,
- gCirrusLogic5430DriverBinding.DriverBindingHandle,
- ControllerHandle
- );
-
- return EFI_UNSUPPORTED;
- }
-
- if (Status != EFI_ALREADY_STARTED) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Get the UGA Draw Protocol on Controller
- //
- Status = gBS->OpenProtocol (
- ControllerHandle,
- &gEfiUgaDrawProtocolGuid,
- (VOID **) &UgaDraw,
- gCirrusLogic5430DriverBinding.DriverBindingHandle,
- ControllerHandle,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
+ Status = EfiTestManagedDevice (
+ ControllerHandle,
+ gCirrusLogic5430DriverBinding.DriverBindingHandle,
+ &gEfiPciIoProtocolGuid
+ );
if (EFI_ERROR (Status)) {
return Status;
}