/* Skip the optional Controller device path node and return the pointer to the next device path node. */
UART_DEVICE_PATH* SkipControllerDevicePathNode(EFI_DEVICE_PATH_PROTOCOL *DevicePath, BOOLEAN *ContainsControllerNode, UINT32 *ControllerNumber)
/* Skip the optional Controller device path node and return the pointer to the next device path node. */
UART_DEVICE_PATH* SkipControllerDevicePathNode(EFI_DEVICE_PATH_PROTOCOL *DevicePath, BOOLEAN *ContainsControllerNode, UINT32 *ControllerNumber)
{
  if ((DevicePathType (DevicePath) == HARDWARE_DEVICE_PATH) &&
      (DevicePathSubType (DevicePath) == HW_CONTROLLER_DP)
      )
  {
    if (ContainsControllerNode != NULL) {
      *ContainsControllerNode = TRUE;
    }
    if (ControllerNumber != NULL) {
      *ControllerNumber = ((CONTROLLER_DEVICE_PATH *)DevicePath)->ControllerNumber;
    }
    DevicePath = NextDevicePathNode (DevicePath);
  } else {
    if (ContainsControllerNode != NULL) {
      *ContainsControllerNode = FALSE;
    }
  }
  return (UART_DEVICE_PATH *)DevicePath;
}