/* Check if there is an error in Status Register. */
EFI_STATUS CheckErrorStatus(IN ATAPI_BLK_IO_DEV *AtapiBlkIoDev, IN UINT16 StatusReg)
/* Check if there is an error in Status Register. */
EFI_STATUS CheckErrorStatus(IN ATAPI_BLK_IO_DEV *AtapiBlkIoDev, IN UINT16 StatusReg)
{
  UINT8  StatusValue;
  StatusValue = IoRead8 (StatusReg);
  if ((StatusValue & (ATA_STSREG_ERR | ATA_STSREG_DWF | ATA_STSREG_CORR)) == 0) {
    return EFI_SUCCESS;
  }
  return EFI_DEVICE_ERROR;
}