Skip to content

Commit

Permalink
drivers: uart_nrfx_uart{,e}: on clear async pointers when enabled
Browse files Browse the repository at this point in the history
Fix a build error introduced in 9f02eea, the async pointers are only
available when UARTE_ANY_ASYNC is set.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
  • Loading branch information
fabiobaltieri committed Jul 24, 2023
1 parent 1b905fd commit ab90285
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/serial/uart_nrfx_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ static int uart_nrfx_callback_set(const struct device *dev,
uart0_cb.callback = callback;
uart0_cb.user_data = user_data;

#if defined(CONFIG_UART_EXCLUSIVE_API_CALLBACKS)
#if defined(CONFIG_UART_EXCLUSIVE_API_CALLBACKS) && defined(CONFIG_UART_0_INTERRUPT_DRIVEN)
irq_callback = NULL;
irq_cb_data = NULL;
#endif
Expand Down Expand Up @@ -929,7 +929,7 @@ static void uart_nrfx_irq_callback_set(const struct device *dev,
irq_callback = cb;
irq_cb_data = cb_data;

#if defined(CONFIG_UART_EXCLUSIVE_API_CALLBACKS)
#if defined(CONFIG_UART_0_ASYNC) && defined(CONFIG_UART_EXCLUSIVE_API_CALLBACKS)
uart0_cb.callback = NULL;
uart0_cb.user_data = NULL;
#endif
Expand Down
4 changes: 2 additions & 2 deletions drivers/serial/uart_nrfx_uarte.c
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ static int uarte_nrfx_callback_set(const struct device *dev,
data->async->user_callback = callback;
data->async->user_data = user_data;

#if defined(CONFIG_UART_EXCLUSIVE_API_CALLBACKS)
#if defined(CONFIG_UART_EXCLUSIVE_API_CALLBACKS) && defined(UARTE_INTERRUPT_DRIVEN)
data->int_driven->cb = NULL;
data->int_driven->cb_data = NULL;
#endif
Expand Down Expand Up @@ -1681,7 +1681,7 @@ static void uarte_nrfx_irq_callback_set(const struct device *dev,
data->int_driven->cb = cb;
data->int_driven->cb_data = cb_data;

#if defined(CONFIG_UART_EXCLUSIVE_API_CALLBACKS)
#if defined(UARTE_ANY_ASYNC) && defined(CONFIG_UART_EXCLUSIVE_API_CALLBACKS)
data->async->user_callback = NULL;
data->async->user_data = NULL;
#endif
Expand Down

0 comments on commit ab90285

Please sign in to comment.