diff --git a/drivers/serial/uart_gecko.c b/drivers/serial/uart_gecko.c index 11c396bcd9f1f4..32d3c71c910c15 100644 --- a/drivers/serial/uart_gecko.c +++ b/drivers/serial/uart_gecko.c @@ -492,13 +492,15 @@ static int uart_gecko_init(const struct device *dev) #ifdef CONFIG_PM_DEVICE static int uart_gecko_pm_action(const struct device *dev, enum pm_device_action action) { - const struct uart_gecko_config *config = dev->config; + __maybe_unused const struct uart_gecko_config *config = dev->config; switch (action) { case PM_DEVICE_ACTION_SUSPEND: +#ifdef USART_STATUS_TXIDLE /* Wait for TX FIFO to flush before suspending */ while (!(USART_StatusGet(config->base) & USART_STATUS_TXIDLE)) { } +#endif break; case PM_DEVICE_ACTION_RESUME: