mirror of https://github.com/acidanthera/audk.git
Apply library to test controller handle.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4323 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
87f8ccbe19
commit
54857d5a7c
|
@ -175,9 +175,7 @@ CirrusLogic5430ComponentNameGetControllerName (
|
||||||
OUT CHAR16 **ControllerName
|
OUT CHAR16 **ControllerName
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_UGA_DRAW_PROTOCOL *UgaDraw;
|
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
EFI_PCI_IO_PROTOCOL *PciIoProtocol;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// This is a device driver, so ChildHandle must be NULL.
|
// 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 (
|
Status = EfiTestManagedDevice (
|
||||||
ControllerHandle,
|
ControllerHandle,
|
||||||
&gEfiPciIoProtocolGuid,
|
gCirrusLogic5430DriverBinding.DriverBindingHandle,
|
||||||
(VOID **) &PciIoProtocol,
|
&gEfiPciIoProtocolGuid
|
||||||
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
|
|
||||||
);
|
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue