arch/nrf{52|53|91}/serial: fix serial registration when ther is no console on serial

This commit is contained in:
raiden00pl 2023-09-20 19:33:13 +02:00 committed by Xiang Xiao
parent f0155b9099
commit dafa4e4413
3 changed files with 9 additions and 12 deletions

View File

@ -86,7 +86,7 @@
#ifdef CONFIG_UART0_SERIAL_CONSOLE
# define CONSOLE_DEV g_uart0port /* UART0 is console */
# define TTYS0_DEV g_uart0port /* UART0 is ttyS0 */
#elif CONFIG_UART1_SERIAL_CONSOLE
#elif defined(CONFIG_UART1_SERIAL_CONSOLE)
# define CONSOLE_DEV g_uart1port /* UART1 is console */
# define TTYS0_DEV g_uart1port /* UART1 is ttyS0 */
#endif
@ -773,10 +773,9 @@ void arm_serialinit(void)
/* Register the serial console */
uart_register("/dev/console", &CONSOLE_DEV);
#endif
uart_register("/dev/ttyS0", &TTYS0_DEV);
minor = 1;
#endif
/* Register all remaining UARTs */
@ -786,7 +785,7 @@ void arm_serialinit(void)
{
/* Don't create a device for non-configured ports. */
if (g_uart_devs[i] == 0)
if (g_uart_devs[i] == NULL)
{
continue;
}

View File

@ -86,7 +86,7 @@
#ifdef CONFIG_UART0_SERIAL_CONSOLE
# define CONSOLE_DEV g_uart0port /* UART0 is console */
# define TTYS0_DEV g_uart0port /* UART0 is ttyS0 */
#elif CONFIG_UART1_SERIAL_CONSOLE
#elif defined(CONFIG_UART1_SERIAL_CONSOLE)
# define CONSOLE_DEV g_uart1port /* UART1 is console */
# define TTYS0_DEV g_uart1port /* UART1 is ttyS0 */
#endif
@ -773,10 +773,9 @@ void arm_serialinit(void)
/* Register the serial console */
uart_register("/dev/console", &CONSOLE_DEV);
#endif
uart_register("/dev/ttyS0", &TTYS0_DEV);
minor = 1;
#endif
/* Register all remaining UARTs */
@ -786,7 +785,7 @@ void arm_serialinit(void)
{
/* Don't create a device for non-configured ports. */
if (g_uart_devs[i] == 0)
if (g_uart_devs[i] == NULL)
{
continue;
}

View File

@ -86,7 +86,7 @@
#ifdef CONFIG_UART0_SERIAL_CONSOLE
# define CONSOLE_DEV g_uart0port /* UART0 is console */
# define TTYS0_DEV g_uart0port /* UART0 is ttyS0 */
#elif CONFIG_UART1_SERIAL_CONSOLE
#elif defined(CONFIG_UART1_SERIAL_CONSOLE)
# define CONSOLE_DEV g_uart1port /* UART1 is console */
# define TTYS0_DEV g_uart1port /* UART1 is ttyS0 */
#endif
@ -773,10 +773,9 @@ void arm_serialinit(void)
/* Register the serial console */
uart_register("/dev/console", &CONSOLE_DEV);
#endif
uart_register("/dev/ttyS0", &TTYS0_DEV);
minor = 1;
#endif
/* Register all remaining UARTs */
@ -786,7 +785,7 @@ void arm_serialinit(void)
{
/* Don't create a device for non-configured ports. */
if (g_uart_devs[i] == 0)
if (g_uart_devs[i] == NULL)
{
continue;
}