diff options
Diffstat (limited to 'MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c')
-rw-r--r-- | MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c index 5ca58fbb9e..7546143ba5 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c @@ -2129,6 +2129,16 @@ XhcDriverBindingStop ( return Status; } + Status = gBS->UninstallProtocolInterface ( + Controller, + &gEfiUsb2HcProtocolGuid, + Usb2Hc + ); + + if (EFI_ERROR (Status)) { + return Status; + } + Xhc = XHC_FROM_THIS (Usb2Hc); PciIo = Xhc->PciIo; @@ -2154,19 +2164,6 @@ XhcDriverBindingStop ( } } - XhcHaltHC (Xhc, XHC_GENERIC_TIMEOUT); - XhcClearBiosOwnership (Xhc); - - Status = gBS->UninstallProtocolInterface ( - Controller, - &gEfiUsb2HcProtocolGuid, - Usb2Hc - ); - - if (EFI_ERROR (Status)) { - return Status; - } - if (Xhc->PollTimer != NULL) { gBS->CloseEvent (Xhc->PollTimer); } @@ -2175,6 +2172,8 @@ XhcDriverBindingStop ( gBS->CloseEvent (Xhc->ExitBootServiceEvent); } + XhcHaltHC (Xhc, XHC_GENERIC_TIMEOUT); + XhcClearBiosOwnership (Xhc); XhciDelAllAsyncIntTransfers (Xhc); XhcFreeSched (Xhc); |