/* This function removes the BY_CHILD_CONTROLLER reference from ParentBusController's VIRTIO_DEVICE_PROTOCOL interface. */
STATIC VOID UninitVgpuGop(IN OUT VGPU_DEV *ParentBus, IN EFI_HANDLE ParentBusController, IN EFI_HANDLE DriverBindingHandle)
/* This function removes the BY_CHILD_CONTROLLER reference from ParentBusController's VIRTIO_DEVICE_PROTOCOL interface. */
STATIC VOID UninitVgpuGop(IN OUT VGPU_DEV *ParentBus, IN EFI_HANDLE ParentBusController, IN EFI_HANDLE DriverBindingHandle)
{
  VGPU_GOP    *VgpuGop;
  EFI_STATUS  Status;
  VgpuGop = ParentBus->Child;
  Status  = gBS->UninstallProtocolInterface (
                   VgpuGop->GopHandle,
                   &gEfiGraphicsOutputProtocolGuid,
                   &VgpuGop->Gop
                   );
  ASSERT_EFI_ERROR (Status);
  ReleaseGopResources (VgpuGop, TRUE);
  Status = gBS->CloseProtocol (
                  ParentBusController,
                  &gVirtioDeviceProtocolGuid,
                  DriverBindingHandle,
                  VgpuGop->GopHandle
                  );
  ASSERT_EFI_ERROR (Status);
  Status = gBS->UninstallProtocolInterface (
                  VgpuGop->GopHandle,
                  &gEfiDevicePathProtocolGuid,
                  VgpuGop->GopDevicePath
                  );
  ASSERT_EFI_ERROR (Status);
  FreePool (VgpuGop->GopDevicePath);
  FreeUnicodeStringTable (VgpuGop->GopName);
  FreePool (VgpuGop);
  ParentBus->Child = NULL;
}