]> git.proxmox.com Git - mirror_edk2.git/commitdiff
If the driver does not start before, we do not disconnect driver and we must still...
authorElvin Li <elvin.li@intel.com>
Thu, 9 Jan 2014 08:47:03 +0000 (08:47 +0000)
committerli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 9 Jan 2014 08:47:03 +0000 (08:47 +0000)
Signed-off-by: Elvin Li <elvin.li@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15069 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c
MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c

index 02c3a0e353f74702591f4235d8ec14a34958b435..c9913c07ca522e5416c5398013c33c185e1569aa 100644 (file)
@@ -1424,22 +1424,20 @@ I2cBusUnload (
                   &DeviceHandleBuffer\r
                   );\r
 \r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Disconnect the driver specified by Driver BindingHandle from all\r
-  // the devices in the handle database.\r
-  //\r
-  for (Index = 0; Index < DeviceHandleCount; Index++) {\r
-    Status = gBS->DisconnectController (\r
-                    DeviceHandleBuffer[Index],\r
-                    gI2cBusDriverBinding.DriverBindingHandle,\r
-                    NULL\r
-                    );\r
-    if (EFI_ERROR (Status)) {\r
-      goto Done;\r
+  if (!EFI_ERROR (Status)) {\r
+    //\r
+    // Disconnect the driver specified by Driver BindingHandle from all\r
+    // the devices in the handle database.\r
+    //\r
+    for (Index = 0; Index < DeviceHandleCount; Index++) {\r
+      Status = gBS->DisconnectController (\r
+                      DeviceHandleBuffer[Index],\r
+                      gI2cBusDriverBinding.DriverBindingHandle,\r
+                      NULL\r
+                      );\r
+      if (EFI_ERROR (Status)) {\r
+        goto Done;\r
+      }\r
     }\r
   }\r
 \r
index 80314d0660a745fc8e480b58497c6e99edf62b0f..0cc8e33842833c846e8adfa28665cac382954403 100644 (file)
@@ -1147,22 +1147,20 @@ I2cHostUnload (
                   &DeviceHandleBuffer\r
                   );\r
 \r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Disconnect the driver specified by ImageHandle from all\r
-  // the devices in the handle database.\r
-  //\r
-  for (Index = 0; Index < DeviceHandleCount; Index++) {\r
-    Status = gBS->DisconnectController (\r
-                    DeviceHandleBuffer[Index],\r
-                    ImageHandle,\r
-                    NULL\r
-                    );\r
-    if (EFI_ERROR (Status)) {\r
-      goto Done;\r
+  if (!EFI_ERROR (Status)) {\r
+    //\r
+    // Disconnect the driver specified by ImageHandle from all\r
+    // the devices in the handle database.\r
+    //\r
+    for (Index = 0; Index < DeviceHandleCount; Index++) {\r
+      Status = gBS->DisconnectController (\r
+                      DeviceHandleBuffer[Index],\r
+                      ImageHandle,\r
+                      NULL\r
+                      );\r
+      if (EFI_ERROR (Status)) {\r
+        goto Done;\r
+      }\r
     }\r
   }\r
 \r