]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/SerialDxe/SerialIo.c
MdeModulePkg/SerialDxe: Fix return valued in SerialSetAttributes
[mirror_edk2.git] / MdeModulePkg / Universal / SerialDxe / SerialIo.c
index 964d0329f4fbcc3f90992ef9f49fb167ec2d6d65..ee10ec7e05eadcb1a5ffc2fc3bd8d0a8d678851e 100644 (file)
@@ -66,8 +66,9 @@ SerialReset (
                            value of DefaultStopBits will use the device's default number of\r
                            stop bits.\r
 \r
-  @retval EFI_SUCCESS      The device was reset.\r
-  @retval EFI_DEVICE_ERROR The serial device could not be reset.\r
+  @retval EFI_SUCCESS           The device was reset.\r
+  @retval EFI_INVALID_PARAMETER One or more attributes has an unsupported value.\r
+  @retval EFI_DEVICE_ERROR      The serial device is not functioning correctly.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -264,8 +265,9 @@ SerialReset (
                            value of DefaultStopBits will use the device's default number of\r
                            stop bits.\r
 \r
-  @retval EFI_SUCCESS      The device was reset.\r
-  @retval EFI_DEVICE_ERROR The serial device could not be reset.\r
+  @retval EFI_SUCCESS           The device was reset.\r
+  @retval EFI_INVALID_PARAMETER One or more attributes has an unsupported value.\r
+  @retval EFI_DEVICE_ERROR      The serial device is not functioning correctly.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -323,8 +325,10 @@ SerialSetAttributes (
       DataBits = OriginalDataBits;\r
       StopBits = OriginalStopBits;\r
       Status = EFI_SUCCESS;\r
+    } else if (Status == EFI_INVALID_PARAMETER || Status == EFI_UNSUPPORTED) {\r
+      return EFI_INVALID_PARAMETER;\r
     } else {\r
-      return Status;\r
+      return EFI_DEVICE_ERROR;\r
     }\r
   }\r
 \r