summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
diff options
context:
space:
mode:
authorFeng Tian <feng.tian@intel.com>2013-12-03 07:04:08 +0000
committererictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2013-12-03 07:04:08 +0000
commit0f58371b5df22ca7894b0febd09d0c95b02da1f0 (patch)
treed29b4bf9a6c320552c93a0d98588b27722e56b1e /MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
parent6855763eb262f3d95dc0216d035cc7203b4e29cc (diff)
downloadedk2-0f58371b5df22ca7894b0febd09d0c95b02da1f0.tar.gz
edk2-0f58371b5df22ca7894b0febd09d0c95b02da1f0.tar.bz2
edk2-0f58371b5df22ca7894b0febd09d0c95b02da1f0.zip
MdeModulePkg/Usb: All h/w related stop operation at DriverBindingStop() should be behind s/w related stop operation, which could avoid h/w not working if s/w stop operation fails.
Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Elvin Li <elvin.li@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14927 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c')
-rw-r--r--MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c b/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
index 00a1094376..a3a28f3edc 100644
--- a/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
+++ b/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
@@ -1550,19 +1550,24 @@ UhciCleanDevUp (
)
{
USB_HC_DEV *Uhc;
+ EFI_STATUS Status;
//
// Uninstall the USB_HC and USB_HC2 protocol, then disable the controller
//
Uhc = UHC_FROM_USB2_HC_PROTO (This);
- UhciStopHc (Uhc, UHC_GENERIC_TIMEOUT);
- gBS->UninstallProtocolInterface (
- Controller,
- &gEfiUsb2HcProtocolGuid,
- &Uhc->Usb2Hc
- );
+ Status = gBS->UninstallProtocolInterface (
+ Controller,
+ &gEfiUsb2HcProtocolGuid,
+ &Uhc->Usb2Hc
+ );
+ if (EFI_ERROR (Status)) {
+ return ;
+ }
+
+ UhciStopHc (Uhc, UHC_GENERIC_TIMEOUT);
UhciFreeAllAsyncReq (Uhc);
UhciDestoryFrameList (Uhc);