]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
1) Add type cast for better coding style.
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / UhciDxe / Uhci.c
index 00a1094376cf14a5831a4abd25b73ea8dd0707a6..34471ab9211e398e9154fc6046d9339159620c06 100644 (file)
@@ -2,7 +2,7 @@
 \r
   The UHCI driver model and HC protocol routines.\r
 \r
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -1550,19 +1550,24 @@ UhciCleanDevUp (
   )\r
 {\r
   USB_HC_DEV          *Uhc;\r
+  EFI_STATUS          Status;\r
 \r
   //\r
   // Uninstall the USB_HC and USB_HC2 protocol, then disable the controller\r
   //\r
   Uhc = UHC_FROM_USB2_HC_PROTO (This);\r
-  UhciStopHc (Uhc, UHC_GENERIC_TIMEOUT);\r
 \r
-  gBS->UninstallProtocolInterface (\r
-        Controller,\r
-        &gEfiUsb2HcProtocolGuid,\r
-        &Uhc->Usb2Hc\r
-        );\r
 \r
+  Status = gBS->UninstallProtocolInterface (\r
+                  Controller,\r
+                  &gEfiUsb2HcProtocolGuid,\r
+                  &Uhc->Usb2Hc\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return ;\r
+  }\r
+\r
+  UhciStopHc (Uhc, UHC_GENERIC_TIMEOUT);\r
   UhciFreeAllAsyncReq (Uhc);\r
   UhciDestoryFrameList (Uhc);\r
 \r
@@ -1583,7 +1588,7 @@ UhciCleanDevUp (
   One notified function to stop the Host Controller when gBS->ExitBootServices() called.\r
 \r
   @param  Event                   Pointer to this event\r
-  @param  Context                 Event hanlder private data\r
+  @param  Context                 Event handler private data\r
 \r
 **/\r
 VOID\r
@@ -1699,7 +1704,7 @@ UhciDriverBindingStart (
                     &Supports\r
                     );\r
   if (!EFI_ERROR (Status)) {\r
-    Supports &= EFI_PCI_DEVICE_ENABLE;\r
+    Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;\r
     Status = PciIo->Attributes (\r
                       PciIo,\r
                       EfiPciIoAttributeOperationEnable,\r