/* Unregister the shutdown notification when mNvmeControllerNumber decreased from 1 to 0.  */
VOID NvmeUnregisterShutdownNotification(VOID)
/* Unregister the shutdown notification when mNvmeControllerNumber decreased from 1 to 0.  */
VOID NvmeUnregisterShutdownNotification(VOID)
{
  EFI_STATUS                       Status;
  EFI_RESET_NOTIFICATION_PROTOCOL  *ResetNotify;
  mNvmeControllerNumber--;
  if (mNvmeControllerNumber == 0) {
    Status = gBS->LocateProtocol (&gEfiResetNotificationProtocolGuid, NULL, (VOID **)&ResetNotify);
    if (!EFI_ERROR (Status)) {
      Status = ResetNotify->UnregisterResetNotify (ResetNotify, NvmeShutdownAllControllers);
      ASSERT_EFI_ERROR (Status);
    }
  }
}