From 0f58371b5df22ca7894b0febd09d0c95b02da1f0 Mon Sep 17 00:00:00 2001 From: Feng Tian Date: Tue, 3 Dec 2013 07:04:08 +0000 Subject: 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 Reviewed-by: Elvin Li git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14927 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c') 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); -- cgit v1.2.3