]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c
If the driver does not start before, we do not disconnect driver and we must still...
[mirror_edk2.git] / MdeModulePkg / Bus / I2c / I2cDxe / I2cHost.c
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