From 29c9b91340e1da31f9ea979975f6a0e895a925c8 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Thu, 28 Nov 2024 21:21:48 +0100 Subject: [PATCH] drivers: serial: Place API into iterable section Add wrapper DEVICE_API macro to all uart_driver_api instances. Signed-off-by: Pieter De Gendt --- drivers/serial/leuart_gecko.c | 2 +- drivers/serial/serial_test.c | 2 +- drivers/serial/uart_altera.c | 2 +- drivers/serial/uart_altera_jtag.c | 2 +- drivers/serial/uart_apbuart.c | 2 +- drivers/serial/uart_b91.c | 2 +- drivers/serial/uart_bcm2711.c | 2 +- drivers/serial/uart_bt.c | 2 +- drivers/serial/uart_cc13xx_cc26xx.c | 2 +- drivers/serial/uart_cc32xx.c | 2 +- drivers/serial/uart_cdns.c | 2 +- drivers/serial/uart_cmsdk_apb.c | 4 ++-- drivers/serial/uart_efinix_sapphire.c | 2 +- drivers/serial/uart_emul.c | 2 +- drivers/serial/uart_ene_kb1200.c | 2 +- drivers/serial/uart_gecko.c | 2 +- drivers/serial/uart_hostlink.c | 2 +- drivers/serial/uart_hvc_xen.c | 2 +- drivers/serial/uart_hvc_xen_consoleio.c | 2 +- drivers/serial/uart_ifx_cat1.c | 2 +- drivers/serial/uart_imx.c | 2 +- drivers/serial/uart_intel_lw.c | 2 +- drivers/serial/uart_litex.c | 2 +- drivers/serial/uart_lpc11u6x.c | 4 ++-- drivers/serial/uart_max32.c | 2 +- drivers/serial/uart_mchp_xec.c | 4 ++-- drivers/serial/uart_mcux.c | 2 +- drivers/serial/uart_mcux_flexcomm.c | 2 +- drivers/serial/uart_mcux_iuart.c | 2 +- drivers/serial/uart_mcux_lpsci.c | 2 +- drivers/serial/uart_mcux_lpuart.c | 2 +- drivers/serial/uart_miv.c | 2 +- drivers/serial/uart_msp432p4xx.c | 2 +- drivers/serial/uart_native_ptty.c | 4 ++-- drivers/serial/uart_native_tty.c | 2 +- drivers/serial/uart_neorv32.c | 2 +- drivers/serial/uart_npcx.c | 2 +- drivers/serial/uart_nrfx_uart.c | 2 +- drivers/serial/uart_nrfx_uarte.c | 2 +- drivers/serial/uart_nrfx_uarte2.c | 2 +- drivers/serial/uart_ns16550.c | 2 +- drivers/serial/uart_numaker.c | 2 +- drivers/serial/uart_numicro.c | 2 +- drivers/serial/uart_nxp_s32_linflexd.c | 2 +- drivers/serial/uart_opentitan.c | 2 +- drivers/serial/uart_pl011.c | 2 +- drivers/serial/uart_psoc6.c | 2 +- drivers/serial/uart_ql_usbserialport_s3b.c | 2 +- drivers/serial/uart_rcar.c | 2 +- drivers/serial/uart_renesas_ra.c | 2 +- drivers/serial/uart_renesas_ra8_sci_b.c | 2 +- drivers/serial/uart_renesas_ra_sci.c | 2 +- drivers/serial/uart_rpi_pico_pio.c | 2 +- drivers/serial/uart_rtt.c | 2 +- drivers/serial/uart_rv32m1_lpuart.c | 2 +- drivers/serial/uart_rzt2m.c | 2 +- drivers/serial/uart_sam.c | 2 +- drivers/serial/uart_sam0.c | 2 +- drivers/serial/uart_sedi.c | 2 +- drivers/serial/uart_si32_usart.c | 2 +- drivers/serial/uart_sifive.c | 2 +- drivers/serial/uart_smartbond.c | 2 +- drivers/serial/uart_stellaris.c | 4 ++-- drivers/serial/uart_stm32.c | 2 +- drivers/serial/uart_sy1xx.c | 2 +- drivers/serial/uart_wch_usart.c | 2 +- drivers/serial/uart_xlnx_ps.c | 2 +- drivers/serial/uart_xlnx_uartlite.c | 2 +- drivers/serial/uart_xmc4xxx.c | 2 +- drivers/serial/usart_gd32.c | 2 +- drivers/serial/usart_sam.c | 2 +- subsys/usb/device/class/cdc_acm.c | 4 ++-- subsys/usb/device_next/class/usbd_cdc_acm.c | 2 +- tests/subsys/mgmt/ec_host_cmd/uart/src/uart_mock.c | 2 +- 74 files changed, 80 insertions(+), 80 deletions(-) diff --git a/drivers/serial/leuart_gecko.c b/drivers/serial/leuart_gecko.c index 335e2285c1a..fb93ede7993 100644 --- a/drivers/serial/leuart_gecko.c +++ b/drivers/serial/leuart_gecko.c @@ -295,7 +295,7 @@ static int leuart_gecko_init(const struct device *dev) return 0; } -static const struct uart_driver_api leuart_gecko_driver_api = { +static DEVICE_API(uart, leuart_gecko_driver_api) = { .poll_in = leuart_gecko_poll_in, .poll_out = leuart_gecko_poll_out, .err_check = leuart_gecko_err_check, diff --git a/drivers/serial/serial_test.c b/drivers/serial/serial_test.c index f04f5eee702..6879cb378af 100644 --- a/drivers/serial/serial_test.c +++ b/drivers/serial/serial_test.c @@ -426,7 +426,7 @@ static int serial_vnd_rx_enable(const struct device *dev, uint8_t *read_buf, siz } #endif /* CONFIG_UART_ASYNC_API */ -static const struct uart_driver_api serial_vnd_api = { +static DEVICE_API(uart, serial_vnd_api) = { .poll_in = serial_vnd_poll_in, .poll_out = serial_vnd_poll_out, .err_check = serial_vnd_err_check, diff --git a/drivers/serial/uart_altera.c b/drivers/serial/uart_altera.c index 6d67d7c39c0..9a5392c7b13 100644 --- a/drivers/serial/uart_altera.c +++ b/drivers/serial/uart_altera.c @@ -901,7 +901,7 @@ static int uart_altera_drv_cmd(const struct device *dev, uint32_t cmd, #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ -static const struct uart_driver_api uart_altera_driver_api = { +static DEVICE_API(uart, uart_altera_driver_api) = { .poll_in = uart_altera_poll_in, .poll_out = uart_altera_poll_out, .err_check = uart_altera_err_check, diff --git a/drivers/serial/uart_altera_jtag.c b/drivers/serial/uart_altera_jtag.c index 18e4af3aa00..d340009d151 100644 --- a/drivers/serial/uart_altera_jtag.c +++ b/drivers/serial/uart_altera_jtag.c @@ -514,7 +514,7 @@ static void uart_altera_jtag_isr(const struct device *dev) #endif /* CONFIG_UART_INTERRUPT_DRIVEN && !CONFIG_UART_ALTERA_JTAG_HAL */ -static const struct uart_driver_api uart_altera_jtag_driver_api = { +static DEVICE_API(uart, uart_altera_jtag_driver_api) = { #ifndef CONFIG_UART_ALTERA_JTAG_HAL .poll_in = uart_altera_jtag_poll_in, #endif /* CONFIG_UART_ALTERA_JTAG_HAL */ diff --git a/drivers/serial/uart_apbuart.c b/drivers/serial/uart_apbuart.c index a50fb126e0a..b59a416222b 100644 --- a/drivers/serial/uart_apbuart.c +++ b/drivers/serial/uart_apbuart.c @@ -516,7 +516,7 @@ static int apbuart_init(const struct device *dev) } /* Driver API defined in uart.h */ -static const struct uart_driver_api apbuart_driver_api = { +static DEVICE_API(uart, apbuart_driver_api) = { .poll_in = apbuart_poll_in, .poll_out = apbuart_poll_out, .err_check = apbuart_err_check, diff --git a/drivers/serial/uart_b91.c b/drivers/serial/uart_b91.c index e2502f4fd9b..cd6be41108f 100644 --- a/drivers/serial/uart_b91.c +++ b/drivers/serial/uart_b91.c @@ -522,7 +522,7 @@ static void uart_b91_irq_callback_set(const struct device *dev, #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ -static const struct uart_driver_api uart_b91_driver_api = { +static DEVICE_API(uart, uart_b91_driver_api) = { .poll_in = uart_b91_poll_in, .poll_out = uart_b91_poll_out, .err_check = uart_b91_err_check, diff --git a/drivers/serial/uart_bcm2711.c b/drivers/serial/uart_bcm2711.c index 2d501f05f5a..415fe2de54c 100644 --- a/drivers/serial/uart_bcm2711.c +++ b/drivers/serial/uart_bcm2711.c @@ -275,7 +275,7 @@ void uart_isr(const struct device *dev) } #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ -static const struct uart_driver_api uart_bcm2711_driver_api = { +static DEVICE_API(uart, uart_bcm2711_driver_api) = { .poll_in = uart_bcm2711_poll_in, .poll_out = uart_bcm2711_poll_out, diff --git a/drivers/serial/uart_bt.c b/drivers/serial/uart_bt.c index b90fb1bc5bb..5b51d0c6b5a 100644 --- a/drivers/serial/uart_bt.c +++ b/drivers/serial/uart_bt.c @@ -289,7 +289,7 @@ static void uart_bt_irq_callback_set(const struct device *dev, dev_data->uart.callback.cb_data = cb_data; } -static const struct uart_driver_api uart_bt_driver_api = { +static DEVICE_API(uart, uart_bt_driver_api) = { .poll_in = uart_bt_poll_in, .poll_out = uart_bt_poll_out, .fifo_fill = uart_bt_fifo_fill, diff --git a/drivers/serial/uart_cc13xx_cc26xx.c b/drivers/serial/uart_cc13xx_cc26xx.c index ae74e74d8ce..969c8df5ec2 100644 --- a/drivers/serial/uart_cc13xx_cc26xx.c +++ b/drivers/serial/uart_cc13xx_cc26xx.c @@ -464,7 +464,7 @@ static int uart_cc13xx_cc26xx_pm_action(const struct device *dev, } #endif /* CONFIG_PM_DEVICE */ -static const struct uart_driver_api uart_cc13xx_cc26xx_driver_api = { +static DEVICE_API(uart, uart_cc13xx_cc26xx_driver_api) = { .poll_in = uart_cc13xx_cc26xx_poll_in, .poll_out = uart_cc13xx_cc26xx_poll_out, .err_check = uart_cc13xx_cc26xx_err_check, diff --git a/drivers/serial/uart_cc32xx.c b/drivers/serial/uart_cc32xx.c index 9427e0a625e..24753af0412 100644 --- a/drivers/serial/uart_cc32xx.c +++ b/drivers/serial/uart_cc32xx.c @@ -290,7 +290,7 @@ static void uart_cc32xx_isr(const struct device *dev) } #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ -static const struct uart_driver_api uart_cc32xx_driver_api = { +static DEVICE_API(uart, uart_cc32xx_driver_api) = { .poll_in = uart_cc32xx_poll_in, .poll_out = uart_cc32xx_poll_out, .err_check = uart_cc32xx_err_check, diff --git a/drivers/serial/uart_cdns.c b/drivers/serial/uart_cdns.c index 9e50052a9d8..1af0fed8d52 100644 --- a/drivers/serial/uart_cdns.c +++ b/drivers/serial/uart_cdns.c @@ -213,7 +213,7 @@ void uart_cdns_set_irq_callback(const struct device *dev, uart_irq_callback_user } #endif -static const struct uart_driver_api uart_cdns_driver_api = { +static DEVICE_API(uart, uart_cdns_driver_api) = { .poll_in = uart_cdns_poll_in, .poll_out = uart_cdns_poll_out, #ifdef CONFIG_UART_INTERRUPT_DRIVEN diff --git a/drivers/serial/uart_cmsdk_apb.c b/drivers/serial/uart_cmsdk_apb.c index e4ceb883bd6..04aa0d06949 100644 --- a/drivers/serial/uart_cmsdk_apb.c +++ b/drivers/serial/uart_cmsdk_apb.c @@ -84,7 +84,7 @@ struct uart_cmsdk_apb_dev_data { const struct arm_clock_control_t uart_cc_dss; }; -static const struct uart_driver_api uart_cmsdk_apb_driver_api; +static DEVICE_API(uart, uart_cmsdk_apb_driver_api); #ifdef CONFIG_UART_INTERRUPT_DRIVEN static void uart_cmsdk_apb_isr(const struct device *dev); #endif @@ -454,7 +454,7 @@ void uart_cmsdk_apb_isr(const struct device *dev) #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ -static const struct uart_driver_api uart_cmsdk_apb_driver_api = { +static DEVICE_API(uart, uart_cmsdk_apb_driver_api) = { .poll_in = uart_cmsdk_apb_poll_in, .poll_out = uart_cmsdk_apb_poll_out, #ifdef CONFIG_UART_INTERRUPT_DRIVEN diff --git a/drivers/serial/uart_efinix_sapphire.c b/drivers/serial/uart_efinix_sapphire.c index 06ce999538a..2723f521eb5 100644 --- a/drivers/serial/uart_efinix_sapphire.c +++ b/drivers/serial/uart_efinix_sapphire.c @@ -57,7 +57,7 @@ static int uart_efinix_sapphire_poll_in(const struct device *dev, unsigned char return -1; } -static const struct uart_driver_api uart_efinix_sapphire_api = { +static DEVICE_API(uart, uart_efinix_sapphire_api) = { .poll_in = uart_efinix_sapphire_poll_in, .poll_out = uart_efinix_sapphire_poll_out, .err_check = NULL, diff --git a/drivers/serial/uart_emul.c b/drivers/serial/uart_emul.c index a00f10486b1..373260af592 100644 --- a/drivers/serial/uart_emul.c +++ b/drivers/serial/uart_emul.c @@ -870,7 +870,7 @@ static int uart_emul_rx_disable(const struct device *dev) } #endif /* CONFIG_UART_ASYNC_API */ -static const struct uart_driver_api uart_emul_api = { +static DEVICE_API(uart, uart_emul_api) = { .poll_in = uart_emul_poll_in, .poll_out = uart_emul_poll_out, #ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE diff --git a/drivers/serial/uart_ene_kb1200.c b/drivers/serial/uart_ene_kb1200.c index 5496d6a60da..b160219fdaa 100644 --- a/drivers/serial/uart_ene_kb1200.c +++ b/drivers/serial/uart_ene_kb1200.c @@ -283,7 +283,7 @@ static void kb1200_uart_poll_out(const struct device *dev, unsigned char c) #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ } -static const struct uart_driver_api kb1200_uart_api = { +static DEVICE_API(uart, kb1200_uart_api) = { .poll_in = kb1200_uart_poll_in, .poll_out = kb1200_uart_poll_out, .err_check = kb1200_uart_err_check, diff --git a/drivers/serial/uart_gecko.c b/drivers/serial/uart_gecko.c index 32d3c71c910..ceecde5d229 100644 --- a/drivers/serial/uart_gecko.c +++ b/drivers/serial/uart_gecko.c @@ -514,7 +514,7 @@ static int uart_gecko_pm_action(const struct device *dev, enum pm_device_action } #endif -static const struct uart_driver_api uart_gecko_driver_api = { +static DEVICE_API(uart, uart_gecko_driver_api) = { .poll_in = uart_gecko_poll_in, .poll_out = uart_gecko_poll_out, .err_check = uart_gecko_err_check, diff --git a/drivers/serial/uart_hostlink.c b/drivers/serial/uart_hostlink.c index 3fa55147a0d..e9c8d48d6c0 100644 --- a/drivers/serial/uart_hostlink.c +++ b/drivers/serial/uart_hostlink.c @@ -391,7 +391,7 @@ static void uart_hostlink_poll_out(const struct device *dev, unsigned char c) hl_write_char(1, c); } -static const struct uart_driver_api uart_hostlink_driver_api = { +static DEVICE_API(uart, uart_hostlink_driver_api) = { .poll_in = uart_hostlink_poll_in, .poll_out = uart_hostlink_poll_out, }; diff --git a/drivers/serial/uart_hvc_xen.c b/drivers/serial/uart_hvc_xen.c index 800603fc258..3283a6ec1e5 100644 --- a/drivers/serial/uart_hvc_xen.c +++ b/drivers/serial/uart_hvc_xen.c @@ -198,7 +198,7 @@ static void xen_hvc_irq_callback_set(const struct device *dev, } #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ -static const struct uart_driver_api xen_hvc_api = { +static DEVICE_API(uart, xen_hvc_api) = { .poll_in = xen_hvc_poll_in, .poll_out = xen_hvc_poll_out, #ifdef CONFIG_UART_INTERRUPT_DRIVEN diff --git a/drivers/serial/uart_hvc_xen_consoleio.c b/drivers/serial/uart_hvc_xen_consoleio.c index 97e411a9306..97d5392d750 100644 --- a/drivers/serial/uart_hvc_xen_consoleio.c +++ b/drivers/serial/uart_hvc_xen_consoleio.c @@ -41,7 +41,7 @@ static void xen_consoleio_poll_out(const struct device *dev, (void) HYPERVISOR_console_io(CONSOLEIO_write, sizeof(c), &c); } -static const struct uart_driver_api xen_consoleio_hvc_api = { +static DEVICE_API(uart, xen_consoleio_hvc_api) = { .poll_in = xen_consoleio_poll_in, .poll_out = xen_consoleio_poll_out, }; diff --git a/drivers/serial/uart_ifx_cat1.c b/drivers/serial/uart_ifx_cat1.c index dd0f01b14e5..c421a01c4a9 100644 --- a/drivers/serial/uart_ifx_cat1.c +++ b/drivers/serial/uart_ifx_cat1.c @@ -482,7 +482,7 @@ static int ifx_cat1_uart_init(const struct device *dev) return ret; } -static const struct uart_driver_api ifx_cat1_uart_driver_api = { +static DEVICE_API(uart, ifx_cat1_uart_driver_api) = { .poll_in = ifx_cat1_uart_poll_in, .poll_out = ifx_cat1_uart_poll_out, .err_check = ifx_cat1_uart_err_check, diff --git a/drivers/serial/uart_imx.c b/drivers/serial/uart_imx.c index 08eb870363b..30ccdcebb55 100644 --- a/drivers/serial/uart_imx.c +++ b/drivers/serial/uart_imx.c @@ -267,7 +267,7 @@ void uart_imx_isr(const struct device *dev) } #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ -static const struct uart_driver_api uart_imx_driver_api = { +static DEVICE_API(uart, uart_imx_driver_api) = { .poll_in = uart_imx_poll_in, .poll_out = uart_imx_poll_out, diff --git a/drivers/serial/uart_intel_lw.c b/drivers/serial/uart_intel_lw.c index 67f2a829778..64c0d0a6dd1 100644 --- a/drivers/serial/uart_intel_lw.c +++ b/drivers/serial/uart_intel_lw.c @@ -935,7 +935,7 @@ static int uart_intel_lw_drv_cmd(const struct device *dev, uint32_t cmd, #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ -static const struct uart_driver_api uart_intel_lw_driver_api = { +static DEVICE_API(uart, uart_intel_lw_driver_api) = { .poll_in = uart_intel_lw_poll_in, .poll_out = uart_intel_lw_poll_out, .err_check = uart_intel_lw_err_check, diff --git a/drivers/serial/uart_litex.c b/drivers/serial/uart_litex.c index 99cbcbe6594..b867cd989b4 100644 --- a/drivers/serial/uart_litex.c +++ b/drivers/serial/uart_litex.c @@ -301,7 +301,7 @@ static void uart_litex_tx_soft_isr(struct k_timer *timer) } #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ -static const struct uart_driver_api uart_litex_driver_api = { +static DEVICE_API(uart, uart_litex_driver_api) = { .poll_in = uart_litex_poll_in, .poll_out = uart_litex_poll_out, .err_check = NULL, diff --git a/drivers/serial/uart_lpc11u6x.c b/drivers/serial/uart_lpc11u6x.c index 3a13850429f..e9a1355d0d6 100644 --- a/drivers/serial/uart_lpc11u6x.c +++ b/drivers/serial/uart_lpc11u6x.c @@ -397,7 +397,7 @@ static const struct lpc11u6x_uart0_config uart0_config = { #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ }; -static const struct uart_driver_api uart0_api = { +static DEVICE_API(uart, uart0_api) = { .poll_in = lpc11u6x_uart0_poll_in, .poll_out = lpc11u6x_uart0_poll_out, .err_check = lpc11u6x_uart0_err_check, @@ -827,7 +827,7 @@ static int lpc11u6x_uartx_init(const struct device *dev) return 0; } -static const struct uart_driver_api uartx_api = { +static DEVICE_API(uart, uartx_api) = { .poll_in = lpc11u6x_uartx_poll_in, .poll_out = lpc11u6x_uartx_poll_out, .err_check = lpc11u6x_uartx_err_check, diff --git a/drivers/serial/uart_max32.c b/drivers/serial/uart_max32.c index 48b90dc26a4..c09cb0b09ba 100644 --- a/drivers/serial/uart_max32.c +++ b/drivers/serial/uart_max32.c @@ -395,7 +395,7 @@ static void uart_max32_isr(const struct device *dev) #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ -static const struct uart_driver_api uart_max32_driver_api = { +static DEVICE_API(uart, uart_max32_driver_api) = { .poll_in = api_poll_in, .poll_out = api_poll_out, .err_check = api_err_check, diff --git a/drivers/serial/uart_mchp_xec.c b/drivers/serial/uart_mchp_xec.c index 5b37d0aa7c8..61310ebe015 100644 --- a/drivers/serial/uart_mchp_xec.c +++ b/drivers/serial/uart_mchp_xec.c @@ -217,7 +217,7 @@ struct uart_xec_dev_data { struct k_work_delayable rx_refresh_timeout_work; #endif -static const struct uart_driver_api uart_xec_driver_api; +static DEVICE_API(uart, uart_xec_driver_api); #if defined(CONFIG_PM_DEVICE) && defined(CONFIG_UART_CONSOLE_INPUT_EXPIRED) static void uart_xec_pm_policy_state_lock_get(enum uart_xec_pm_policy_state_flag flag) @@ -1001,7 +1001,7 @@ static int uart_xec_line_ctrl_set(const struct device *dev, #endif /* CONFIG_UART_XEC_LINE_CTRL */ -static const struct uart_driver_api uart_xec_driver_api = { +static DEVICE_API(uart, uart_xec_driver_api) = { .poll_in = uart_xec_poll_in, .poll_out = uart_xec_poll_out, .err_check = uart_xec_err_check, diff --git a/drivers/serial/uart_mcux.c b/drivers/serial/uart_mcux.c index 07b0a0e44e2..e7218f7b690 100644 --- a/drivers/serial/uart_mcux.c +++ b/drivers/serial/uart_mcux.c @@ -367,7 +367,7 @@ static int uart_mcux_pm_action(const struct device *dev, enum pm_device_action a } #endif /*CONFIG_PM_DEVICE*/ -static const struct uart_driver_api uart_mcux_driver_api = { +static DEVICE_API(uart, uart_mcux_driver_api) = { .poll_in = uart_mcux_poll_in, .poll_out = uart_mcux_poll_out, .err_check = uart_mcux_err_check, diff --git a/drivers/serial/uart_mcux_flexcomm.c b/drivers/serial/uart_mcux_flexcomm.c index b39a3a48f11..b0a51b4d1a3 100644 --- a/drivers/serial/uart_mcux_flexcomm.c +++ b/drivers/serial/uart_mcux_flexcomm.c @@ -1067,7 +1067,7 @@ static int mcux_flexcomm_init(const struct device *dev) return 0; } -static const struct uart_driver_api mcux_flexcomm_driver_api = { +static DEVICE_API(uart, mcux_flexcomm_driver_api) = { .poll_in = mcux_flexcomm_poll_in, .poll_out = mcux_flexcomm_poll_out, .err_check = mcux_flexcomm_err_check, diff --git a/drivers/serial/uart_mcux_iuart.c b/drivers/serial/uart_mcux_iuart.c index d067f7f6220..6906d6c98b6 100644 --- a/drivers/serial/uart_mcux_iuart.c +++ b/drivers/serial/uart_mcux_iuart.c @@ -273,7 +273,7 @@ static int mcux_iuart_init(const struct device *dev) return 0; } -static const struct uart_driver_api mcux_iuart_driver_api = { +static DEVICE_API(uart, mcux_iuart_driver_api) = { .poll_in = mcux_iuart_poll_in, .poll_out = mcux_iuart_poll_out, .err_check = mcux_iuart_err_check, diff --git a/drivers/serial/uart_mcux_lpsci.c b/drivers/serial/uart_mcux_lpsci.c index 6a87ef217d7..421f3b5b11b 100644 --- a/drivers/serial/uart_mcux_lpsci.c +++ b/drivers/serial/uart_mcux_lpsci.c @@ -270,7 +270,7 @@ static int mcux_lpsci_init(const struct device *dev) return 0; } -static const struct uart_driver_api mcux_lpsci_driver_api = { +static DEVICE_API(uart, mcux_lpsci_driver_api) = { .poll_in = mcux_lpsci_poll_in, .poll_out = mcux_lpsci_poll_out, .err_check = mcux_lpsci_err_check, diff --git a/drivers/serial/uart_mcux_lpuart.c b/drivers/serial/uart_mcux_lpuart.c index 67fc33fef31..87b6f7d5717 100644 --- a/drivers/serial/uart_mcux_lpuart.c +++ b/drivers/serial/uart_mcux_lpuart.c @@ -1235,7 +1235,7 @@ static int mcux_lpuart_init(const struct device *dev) return 0; } -static const struct uart_driver_api mcux_lpuart_driver_api = { +static DEVICE_API(uart, mcux_lpuart_driver_api) = { .poll_in = mcux_lpuart_poll_in, .poll_out = mcux_lpuart_poll_out, .err_check = mcux_lpuart_err_check, diff --git a/drivers/serial/uart_miv.c b/drivers/serial/uart_miv.c index d1b5cfb0e26..5d74d321b47 100644 --- a/drivers/serial/uart_miv.c +++ b/drivers/serial/uart_miv.c @@ -361,7 +361,7 @@ static int uart_miv_init(const struct device *dev) return 0; } -static const struct uart_driver_api uart_miv_driver_api = { +static DEVICE_API(uart, uart_miv_driver_api) = { .poll_in = uart_miv_poll_in, .poll_out = uart_miv_poll_out, .err_check = uart_miv_err_check, diff --git a/drivers/serial/uart_msp432p4xx.c b/drivers/serial/uart_msp432p4xx.c index bbdacfbab0e..65d768f58d1 100644 --- a/drivers/serial/uart_msp432p4xx.c +++ b/drivers/serial/uart_msp432p4xx.c @@ -327,7 +327,7 @@ static void uart_msp432p4xx_isr(const struct device *dev) } #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ -static const struct uart_driver_api uart_msp432p4xx_driver_api = { +static DEVICE_API(uart, uart_msp432p4xx_driver_api) = { .poll_in = uart_msp432p4xx_poll_in, .poll_out = uart_msp432p4xx_poll_out, #ifdef CONFIG_UART_INTERRUPT_DRIVEN diff --git a/drivers/serial/uart_native_ptty.c b/drivers/serial/uart_native_ptty.c index 85827eb3b10..c0cf3036dd2 100644 --- a/drivers/serial/uart_native_ptty.c +++ b/drivers/serial/uart_native_ptty.c @@ -52,7 +52,7 @@ struct native_uart_status { static struct native_uart_status native_uart_status_0; -static struct uart_driver_api np_uart_driver_api_0 = { +static DEVICE_API(uart, np_uart_driver_api_0) = { .poll_out = np_uart_poll_out, #if defined(CONFIG_NATIVE_UART_0_ON_OWN_PTY) .poll_in = np_uart_tty_poll_in, @@ -64,7 +64,7 @@ static struct uart_driver_api np_uart_driver_api_0 = { #if defined(CONFIG_UART_NATIVE_POSIX_PORT_1_ENABLE) static struct native_uart_status native_uart_status_1; -static struct uart_driver_api np_uart_driver_api_1 = { +static DEVICE_API(uart, np_uart_driver_api_1) = { .poll_out = np_uart_poll_out, .poll_in = np_uart_tty_poll_in, }; diff --git a/drivers/serial/uart_native_tty.c b/drivers/serial/uart_native_tty.c index 4f2acc50b34..98006616a5a 100644 --- a/drivers/serial/uart_native_tty.c +++ b/drivers/serial/uart_native_tty.c @@ -366,7 +366,7 @@ static int native_tty_serial_init(const struct device *dev) return 0; } -static struct uart_driver_api native_tty_uart_driver_api = { +static DEVICE_API(uart, native_tty_uart_driver_api) = { .poll_out = native_tty_uart_poll_out, .poll_in = native_tty_uart_poll_in, #ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE diff --git a/drivers/serial/uart_neorv32.c b/drivers/serial/uart_neorv32.c index 5c14b18060e..c4668e7e27c 100644 --- a/drivers/serial/uart_neorv32.c +++ b/drivers/serial/uart_neorv32.c @@ -439,7 +439,7 @@ static int neorv32_uart_pm_action(const struct device *dev, } #endif /* CONFIG_PM_DEVICE */ -static const struct uart_driver_api neorv32_uart_driver_api = { +static DEVICE_API(uart, neorv32_uart_driver_api) = { .poll_in = neorv32_uart_poll_in, .poll_out = neorv32_uart_poll_out, #ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE diff --git a/drivers/serial/uart_npcx.c b/drivers/serial/uart_npcx.c index cc3e9962e2e..fc68fce79b0 100644 --- a/drivers/serial/uart_npcx.c +++ b/drivers/serial/uart_npcx.c @@ -975,7 +975,7 @@ static void uart_npcx_rx_refresh_timeout(struct k_work *work) #endif /* UART driver registration */ -static const struct uart_driver_api uart_npcx_driver_api = { +static DEVICE_API(uart, uart_npcx_driver_api) = { .poll_in = uart_npcx_poll_in, .poll_out = uart_npcx_poll_out, .err_check = uart_npcx_err_check, diff --git a/drivers/serial/uart_nrfx_uart.c b/drivers/serial/uart_nrfx_uart.c index c151ef49058..278b901eedf 100644 --- a/drivers/serial/uart_nrfx_uart.c +++ b/drivers/serial/uart_nrfx_uart.c @@ -1044,7 +1044,7 @@ static int uart_nrfx_init(const struct device *dev) /* Common function: uart_nrfx_irq_tx_ready_complete is used for two API entries * because Nordic hardware does not distinguish between them. */ -static const struct uart_driver_api uart_nrfx_uart_driver_api = { +static DEVICE_API(uart, uart_nrfx_uart_driver_api) = { #ifdef CONFIG_UART_0_ASYNC .callback_set = uart_nrfx_callback_set, .tx = uart_nrfx_tx, diff --git a/drivers/serial/uart_nrfx_uarte.c b/drivers/serial/uart_nrfx_uarte.c index 5c0f706aef9..8b139e99abc 100644 --- a/drivers/serial/uart_nrfx_uarte.c +++ b/drivers/serial/uart_nrfx_uarte.c @@ -2017,7 +2017,7 @@ static void uarte_nrfx_irq_callback_set(const struct device *dev, } #endif /* UARTE_INTERRUPT_DRIVEN */ -static const struct uart_driver_api uart_nrfx_uarte_driver_api = { +static DEVICE_API(uart, uart_nrfx_uarte_driver_api) = { .poll_in = uarte_nrfx_poll_in, .poll_out = uarte_nrfx_poll_out, .err_check = uarte_nrfx_err_check, diff --git a/drivers/serial/uart_nrfx_uarte2.c b/drivers/serial/uart_nrfx_uarte2.c index ae25334f03f..80adc73626f 100644 --- a/drivers/serial/uart_nrfx_uarte2.c +++ b/drivers/serial/uart_nrfx_uarte2.c @@ -749,7 +749,7 @@ static const struct uart_async_to_irq_async_api a2i_api = { .rx_disable = api_rx_disable, }; -static const struct uart_driver_api uart_nrfx_uarte_driver_api = { +static DEVICE_API(uart, uart_nrfx_uarte_driver_api) = { .poll_in = api_poll_in, .poll_out = api_poll_out, #ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE diff --git a/drivers/serial/uart_ns16550.c b/drivers/serial/uart_ns16550.c index a7a7df1f21a..ea80df30701 100644 --- a/drivers/serial/uart_ns16550.c +++ b/drivers/serial/uart_ns16550.c @@ -1759,7 +1759,7 @@ static void uart_ns16550_async_tx_timeout(struct k_work *work) #endif /* CONFIG_UART_ASYNC_API */ -static const struct uart_driver_api uart_ns16550_driver_api = { +static DEVICE_API(uart, uart_ns16550_driver_api) = { .poll_in = uart_ns16550_poll_in, .poll_out = uart_ns16550_poll_out, .err_check = uart_ns16550_err_check, diff --git a/drivers/serial/uart_numaker.c b/drivers/serial/uart_numaker.c index 4952753188d..3556402c51b 100644 --- a/drivers/serial/uart_numaker.c +++ b/drivers/serial/uart_numaker.c @@ -377,7 +377,7 @@ static void uart_numaker_isr(const struct device *dev) #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ -static const struct uart_driver_api uart_numaker_driver_api = { +static DEVICE_API(uart, uart_numaker_driver_api) = { .poll_in = uart_numaker_poll_in, .poll_out = uart_numaker_poll_out, .err_check = uart_numaker_err_check, diff --git a/drivers/serial/uart_numicro.c b/drivers/serial/uart_numicro.c index 8b9d1e02ee2..a3b877317d0 100644 --- a/drivers/serial/uart_numicro.c +++ b/drivers/serial/uart_numicro.c @@ -173,7 +173,7 @@ static int uart_numicro_init(const struct device *dev) return 0; } -static const struct uart_driver_api uart_numicro_driver_api = { +static DEVICE_API(uart, uart_numicro_driver_api) = { .poll_in = uart_numicro_poll_in, .poll_out = uart_numicro_poll_out, .err_check = uart_numicro_err_check, diff --git a/drivers/serial/uart_nxp_s32_linflexd.c b/drivers/serial/uart_nxp_s32_linflexd.c index 4ab143a4f6e..e0f958d6bab 100644 --- a/drivers/serial/uart_nxp_s32_linflexd.c +++ b/drivers/serial/uart_nxp_s32_linflexd.c @@ -306,7 +306,7 @@ static int uart_nxp_s32_init(const struct device *dev) return 0; } -static const struct uart_driver_api uart_nxp_s32_driver_api = { +static DEVICE_API(uart, uart_nxp_s32_driver_api) = { .poll_in = uart_nxp_s32_poll_in, .poll_out = uart_nxp_s32_poll_out, .err_check = uart_nxp_s32_err_check, diff --git a/drivers/serial/uart_opentitan.c b/drivers/serial/uart_opentitan.c index 0d27c7a3d04..8db5485ed48 100644 --- a/drivers/serial/uart_opentitan.c +++ b/drivers/serial/uart_opentitan.c @@ -93,7 +93,7 @@ static void uart_opentitan_poll_out(const struct device *dev, unsigned char c) sys_write32(c, cfg->base + UART_WDATA_REG_OFFSET); } -static const struct uart_driver_api uart_opentitan_driver_api = { +static DEVICE_API(uart, uart_opentitan_driver_api) = { .poll_in = uart_opentitan_poll_in, .poll_out = uart_opentitan_poll_out, }; diff --git a/drivers/serial/uart_pl011.c b/drivers/serial/uart_pl011.c index 130d4e95957..cbaa507e9a7 100644 --- a/drivers/serial/uart_pl011.c +++ b/drivers/serial/uart_pl011.c @@ -441,7 +441,7 @@ static void pl011_irq_callback_set(const struct device *dev, } #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ -static const struct uart_driver_api pl011_driver_api = { +static DEVICE_API(uart, pl011_driver_api) = { .poll_in = pl011_poll_in, .poll_out = pl011_poll_out, .err_check = pl011_err_check, diff --git a/drivers/serial/uart_psoc6.c b/drivers/serial/uart_psoc6.c index d0482c46a3a..713526ad78f 100644 --- a/drivers/serial/uart_psoc6.c +++ b/drivers/serial/uart_psoc6.c @@ -303,7 +303,7 @@ static void uart_psoc6_isr(const struct device *dev) #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ -static const struct uart_driver_api uart_psoc6_driver_api = { +static DEVICE_API(uart, uart_psoc6_driver_api) = { .poll_in = uart_psoc6_poll_in, .poll_out = uart_psoc6_poll_out, .err_check = uart_psoc6_err_check, diff --git a/drivers/serial/uart_ql_usbserialport_s3b.c b/drivers/serial/uart_ql_usbserialport_s3b.c index 48b698e15fe..a85ff0870a6 100644 --- a/drivers/serial/uart_ql_usbserialport_s3b.c +++ b/drivers/serial/uart_ql_usbserialport_s3b.c @@ -76,7 +76,7 @@ static int uart_usbserial_poll_in(const struct device *dev, unsigned char *c) return 0; } -static const struct uart_driver_api uart_usbserial_driver_api = { +static DEVICE_API(uart, uart_usbserial_driver_api) = { .poll_in = uart_usbserial_poll_in, .poll_out = uart_usbserial_poll_out, }; diff --git a/drivers/serial/uart_rcar.c b/drivers/serial/uart_rcar.c index c330f0f4f96..07834fa005e 100644 --- a/drivers/serial/uart_rcar.c +++ b/drivers/serial/uart_rcar.c @@ -515,7 +515,7 @@ void uart_rcar_isr(const struct device *dev) #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ -static const struct uart_driver_api uart_rcar_driver_api = { +static DEVICE_API(uart, uart_rcar_driver_api) = { .poll_in = uart_rcar_poll_in, .poll_out = uart_rcar_poll_out, #ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE diff --git a/drivers/serial/uart_renesas_ra.c b/drivers/serial/uart_renesas_ra.c index 269a26a59f5..60758db553b 100644 --- a/drivers/serial/uart_renesas_ra.c +++ b/drivers/serial/uart_renesas_ra.c @@ -629,7 +629,7 @@ static void uart_ra_isr_eri(const void *param) #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ -static const struct uart_driver_api uart_ra_driver_api = { +static DEVICE_API(uart, uart_ra_driver_api) = { .poll_in = uart_ra_poll_in, .poll_out = uart_ra_poll_out, .err_check = uart_ra_err_check, diff --git a/drivers/serial/uart_renesas_ra8_sci_b.c b/drivers/serial/uart_renesas_ra8_sci_b.c index 78b870e3f08..e9209ffcc29 100644 --- a/drivers/serial/uart_renesas_ra8_sci_b.c +++ b/drivers/serial/uart_renesas_ra8_sci_b.c @@ -833,7 +833,7 @@ static void uart_ra_sci_b_callback_adapter(struct st_uart_callback_arg *fsp_args #endif /* CONFIG_UART_ASYNC_API */ -static const struct uart_driver_api uart_ra_sci_b_driver_api = { +static DEVICE_API(uart, uart_ra_sci_b_driver_api) = { .poll_in = uart_ra_sci_b_poll_in, .poll_out = uart_ra_sci_b_poll_out, .err_check = uart_ra_sci_b_err_check, diff --git a/drivers/serial/uart_renesas_ra_sci.c b/drivers/serial/uart_renesas_ra_sci.c index 0e9f927a357..24ce1f0a2f8 100644 --- a/drivers/serial/uart_renesas_ra_sci.c +++ b/drivers/serial/uart_renesas_ra_sci.c @@ -904,7 +904,7 @@ static void uart_ra_sci_tx_timeout_handler(struct k_work *work) #endif /* CONFIG_UART_ASYNC_API */ -static const struct uart_driver_api uart_ra_sci_driver_api = { +static DEVICE_API(uart, uart_ra_sci_driver_api) = { .poll_in = uart_ra_sci_poll_in, .poll_out = uart_ra_sci_poll_out, .err_check = uart_ra_sci_err_check, diff --git a/drivers/serial/uart_rpi_pico_pio.c b/drivers/serial/uart_rpi_pico_pio.c index 30ca3a40e25..cfbd084c86b 100644 --- a/drivers/serial/uart_rpi_pico_pio.c +++ b/drivers/serial/uart_rpi_pico_pio.c @@ -176,7 +176,7 @@ static int pio_uart_init(const struct device *dev) return pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); } -static const struct uart_driver_api pio_uart_driver_api = { +static DEVICE_API(uart, pio_uart_driver_api) = { .poll_in = pio_uart_poll_in, .poll_out = pio_uart_poll_out, }; diff --git a/drivers/serial/uart_rtt.c b/drivers/serial/uart_rtt.c index 7ed234329b8..3c31497a3c8 100644 --- a/drivers/serial/uart_rtt.c +++ b/drivers/serial/uart_rtt.c @@ -160,7 +160,7 @@ static int uart_rtt_rx_buf_rsp(const struct device *dev, #endif /* CONFIG_UART_ASYNC_API */ -static const struct uart_driver_api uart_rtt_driver_api = { +static DEVICE_API(uart, uart_rtt_driver_api) = { .poll_in = uart_rtt_poll_in, .poll_out = uart_rtt_poll_out, #ifdef CONFIG_UART_ASYNC_API diff --git a/drivers/serial/uart_rv32m1_lpuart.c b/drivers/serial/uart_rv32m1_lpuart.c index 603a1cd0617..872d057619b 100644 --- a/drivers/serial/uart_rv32m1_lpuart.c +++ b/drivers/serial/uart_rv32m1_lpuart.c @@ -281,7 +281,7 @@ static int rv32m1_lpuart_init(const struct device *dev) return 0; } -static const struct uart_driver_api rv32m1_lpuart_driver_api = { +static DEVICE_API(uart, rv32m1_lpuart_driver_api) = { .poll_in = rv32m1_lpuart_poll_in, .poll_out = rv32m1_lpuart_poll_out, .err_check = rv32m1_lpuart_err_check, diff --git a/drivers/serial/uart_rzt2m.c b/drivers/serial/uart_rzt2m.c index ae8a90a4546..83b929619ea 100644 --- a/drivers/serial/uart_rzt2m.c +++ b/drivers/serial/uart_rzt2m.c @@ -216,7 +216,7 @@ static int uart_rzt2m_irq_update(const struct device *dev) } #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ -static const struct uart_driver_api rzt2m_uart_api = { +static DEVICE_API(uart, rzt2m_uart_api) = { .poll_in = rzt2m_poll_in, .poll_out = rzt2m_poll_out, .err_check = rzt2m_err_check, diff --git a/drivers/serial/uart_sam.c b/drivers/serial/uart_sam.c index 81c059ac1ea..782a65cfbb9 100644 --- a/drivers/serial/uart_sam.c +++ b/drivers/serial/uart_sam.c @@ -417,7 +417,7 @@ static int uart_sam_init(const struct device *dev) return uart_sam_configure(dev, &uart_config); } -static const struct uart_driver_api uart_sam_driver_api = { +static DEVICE_API(uart, uart_sam_driver_api) = { .poll_in = uart_sam_poll_in, .poll_out = uart_sam_poll_out, .err_check = uart_sam_err_check, diff --git a/drivers/serial/uart_sam0.c b/drivers/serial/uart_sam0.c index 35931fe5a17..10e222f12c6 100644 --- a/drivers/serial/uart_sam0.c +++ b/drivers/serial/uart_sam0.c @@ -1180,7 +1180,7 @@ static int uart_sam0_rx_disable(const struct device *dev) #endif -static const struct uart_driver_api uart_sam0_driver_api = { +static DEVICE_API(uart, uart_sam0_driver_api) = { .poll_in = uart_sam0_poll_in, .poll_out = uart_sam0_poll_out, #ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE diff --git a/drivers/serial/uart_sedi.c b/drivers/serial/uart_sedi.c index 74fcc4a5040..3a82a9a7747 100644 --- a/drivers/serial/uart_sedi.c +++ b/drivers/serial/uart_sedi.c @@ -513,7 +513,7 @@ static int uart_sedi_line_ctrl_get(struct device *dev, #endif /* CONFIG_UART_LINE_CTRL */ -static const struct uart_driver_api api = { +static DEVICE_API(uart, api) = { .poll_in = uart_sedi_poll_in, .poll_out = uart_sedi_poll_out, .err_check = uart_sedi_err_check, diff --git a/drivers/serial/uart_si32_usart.c b/drivers/serial/uart_si32_usart.c index a5151318803..472f53c244c 100644 --- a/drivers/serial/uart_si32_usart.c +++ b/drivers/serial/uart_si32_usart.c @@ -219,7 +219,7 @@ static void usart_si32_irq_handler(const struct device *dev) } #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ -static const struct uart_driver_api usart_si32_driver_api = { +static DEVICE_API(uart, usart_si32_driver_api) = { .poll_in = usart_si32_poll_in, .poll_out = usart_si32_poll_out, .err_check = usart_si32_err_check, diff --git a/drivers/serial/uart_sifive.c b/drivers/serial/uart_sifive.c index f0fa3d501ff..6194e7fae3d 100644 --- a/drivers/serial/uart_sifive.c +++ b/drivers/serial/uart_sifive.c @@ -354,7 +354,7 @@ static int uart_sifive_init(const struct device *dev) return 0; } -static const struct uart_driver_api uart_sifive_driver_api = { +static DEVICE_API(uart, uart_sifive_driver_api) = { .poll_in = uart_sifive_poll_in, .poll_out = uart_sifive_poll_out, .err_check = NULL, diff --git a/drivers/serial/uart_smartbond.c b/drivers/serial/uart_smartbond.c index 6adb0650a5d..77850244b6b 100644 --- a/drivers/serial/uart_smartbond.c +++ b/drivers/serial/uart_smartbond.c @@ -726,7 +726,7 @@ static int uart_smartbond_pm_action(const struct device *dev, } #endif /* CONFIG_PM_DEVICE */ -static const struct uart_driver_api uart_smartbond_driver_api = { +static DEVICE_API(uart, uart_smartbond_driver_api) = { .poll_in = uart_smartbond_poll_in, .poll_out = uart_smartbond_poll_out, #ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE diff --git a/drivers/serial/uart_stellaris.c b/drivers/serial/uart_stellaris.c index 731ea8a3c09..fbdca0a4088 100644 --- a/drivers/serial/uart_stellaris.c +++ b/drivers/serial/uart_stellaris.c @@ -112,7 +112,7 @@ struct uart_stellaris_dev_data_t { #define UARTMIS_RXMIS 0x00000010 #define UARTMIS_TXMIS 0x00000020 -static const struct uart_driver_api uart_stellaris_driver_api; +static DEVICE_API(uart, uart_stellaris_driver_api); /** * @brief Set the baud rate @@ -549,7 +549,7 @@ static void uart_stellaris_isr(const struct device *dev) #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ -static const struct uart_driver_api uart_stellaris_driver_api = { +static DEVICE_API(uart, uart_stellaris_driver_api) = { .poll_in = uart_stellaris_poll_in, .poll_out = uart_stellaris_poll_out, diff --git a/drivers/serial/uart_stm32.c b/drivers/serial/uart_stm32.c index 97c0bbdf853..d0c511b3b4a 100644 --- a/drivers/serial/uart_stm32.c +++ b/drivers/serial/uart_stm32.c @@ -1899,7 +1899,7 @@ static int uart_stm32_async_rx_buf_rsp_u16(const struct device *dev, uint16_t *b #endif /* CONFIG_UART_ASYNC_API */ -static const struct uart_driver_api uart_stm32_driver_api = { +static DEVICE_API(uart, uart_stm32_driver_api) = { .poll_in = uart_stm32_poll_in, .poll_out = uart_stm32_poll_out, #ifdef CONFIG_UART_WIDE_DATA diff --git a/drivers/serial/uart_sy1xx.c b/drivers/serial/uart_sy1xx.c index b0552719b52..7bc4de39380 100644 --- a/drivers/serial/uart_sy1xx.c +++ b/drivers/serial/uart_sy1xx.c @@ -296,7 +296,7 @@ static int sy1xx_uart_init(const struct device *dev) return 0; } -static const struct uart_driver_api sy1xx_uart_driver_api = { +static DEVICE_API(uart, sy1xx_uart_driver_api) = { .poll_in = sy1xx_uart_poll_in, .poll_out = sy1xx_uart_poll_out, diff --git a/drivers/serial/uart_wch_usart.c b/drivers/serial/uart_wch_usart.c index edd65ca9ea7..aac67c8e63e 100644 --- a/drivers/serial/uart_wch_usart.c +++ b/drivers/serial/uart_wch_usart.c @@ -116,7 +116,7 @@ static int usart_wch_err_check(const struct device *dev) return errors; } -static const struct uart_driver_api usart_wch_driver_api = { +static DEVICE_API(uart, usart_wch_driver_api) = { .poll_in = usart_wch_poll_in, .poll_out = usart_wch_poll_out, .err_check = usart_wch_err_check, diff --git a/drivers/serial/uart_xlnx_ps.c b/drivers/serial/uart_xlnx_ps.c index 68b3a7baabd..122ac11a80d 100644 --- a/drivers/serial/uart_xlnx_ps.c +++ b/drivers/serial/uart_xlnx_ps.c @@ -1096,7 +1096,7 @@ static void uart_xlnx_ps_isr(const struct device *dev) } #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ -static const struct uart_driver_api uart_xlnx_ps_driver_api = { +static DEVICE_API(uart, uart_xlnx_ps_driver_api) = { .poll_in = uart_xlnx_ps_poll_in, .poll_out = uart_xlnx_ps_poll_out, #ifdef CONFIG_UART_USE_RUNTIME_CONFIGURE diff --git a/drivers/serial/uart_xlnx_uartlite.c b/drivers/serial/uart_xlnx_uartlite.c index 1a4b0456494..6ae60cf1d0b 100644 --- a/drivers/serial/uart_xlnx_uartlite.c +++ b/drivers/serial/uart_xlnx_uartlite.c @@ -354,7 +354,7 @@ static int xlnx_uartlite_init(const struct device *dev) return 0; } -static const struct uart_driver_api xlnx_uartlite_driver_api = { +static DEVICE_API(uart, xlnx_uartlite_driver_api) = { .poll_in = xlnx_uartlite_poll_in, .poll_out = xlnx_uartlite_poll_out, .err_check = xlnx_uartlite_err_check, diff --git a/drivers/serial/uart_xmc4xxx.c b/drivers/serial/uart_xmc4xxx.c index f797e27a11e..770b86aee8d 100644 --- a/drivers/serial/uart_xmc4xxx.c +++ b/drivers/serial/uart_xmc4xxx.c @@ -940,7 +940,7 @@ static int uart_xmc4xxx_init(const struct device *dev) return ret; } -static const struct uart_driver_api uart_xmc4xxx_driver_api = { +static DEVICE_API(uart, uart_xmc4xxx_driver_api) = { .poll_in = uart_xmc4xxx_poll_in, .poll_out = uart_xmc4xxx_poll_out, #if defined(CONFIG_UART_INTERRUPT_DRIVEN) diff --git a/drivers/serial/usart_gd32.c b/drivers/serial/usart_gd32.c index 4e5ac37a230..9936a818124 100644 --- a/drivers/serial/usart_gd32.c +++ b/drivers/serial/usart_gd32.c @@ -284,7 +284,7 @@ void usart_gd32_irq_callback_set(const struct device *dev, } #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ -static const struct uart_driver_api usart_gd32_driver_api = { +static DEVICE_API(uart, usart_gd32_driver_api) = { .poll_in = usart_gd32_poll_in, .poll_out = usart_gd32_poll_out, .err_check = usart_gd32_err_check, diff --git a/drivers/serial/usart_sam.c b/drivers/serial/usart_sam.c index 43ba14c8fa0..a29083a68c1 100644 --- a/drivers/serial/usart_sam.c +++ b/drivers/serial/usart_sam.c @@ -512,7 +512,7 @@ static int usart_sam_init(const struct device *dev) return usart_sam_configure(dev, &uart_config); } -static const struct uart_driver_api usart_sam_driver_api = { +static DEVICE_API(uart, usart_sam_driver_api) = { .poll_in = usart_sam_poll_in, .poll_out = usart_sam_poll_out, .err_check = usart_sam_err_check, diff --git a/subsys/usb/device/class/cdc_acm.c b/subsys/usb/device/class/cdc_acm.c index 7e5fbbb672a..469215e6aa5 100644 --- a/subsys/usb/device/class/cdc_acm.c +++ b/subsys/usb/device/class/cdc_acm.c @@ -138,7 +138,7 @@ struct cdc_acm_dev_data_t { }; static sys_slist_t cdc_acm_data_devlist; -static const struct uart_driver_api cdc_acm_driver_api; +static DEVICE_API(uart, cdc_acm_driver_api); /** * @brief Handler called for Class requests not handled by the USB stack. @@ -1053,7 +1053,7 @@ static void cdc_acm_poll_out(const struct device *dev, unsigned char c) k_work_schedule_for_queue(&USB_WORK_Q, &dev_data->tx_work, K_MSEC(1)); } -static const struct uart_driver_api cdc_acm_driver_api = { +static DEVICE_API(uart, cdc_acm_driver_api) = { .poll_in = cdc_acm_poll_in, .poll_out = cdc_acm_poll_out, .fifo_fill = cdc_acm_fifo_fill, diff --git a/subsys/usb/device_next/class/usbd_cdc_acm.c b/subsys/usb/device_next/class/usbd_cdc_acm.c index 15fa82ad9eb..ee293cab75e 100644 --- a/subsys/usb/device_next/class/usbd_cdc_acm.c +++ b/subsys/usb/device_next/class/usbd_cdc_acm.c @@ -1048,7 +1048,7 @@ static int usbd_cdc_acm_preinit(const struct device *dev) return 0; } -static const struct uart_driver_api cdc_acm_uart_api = { +static DEVICE_API(uart, cdc_acm_uart_api) = { .irq_tx_enable = cdc_acm_irq_tx_enable, .irq_tx_disable = cdc_acm_irq_tx_disable, .irq_tx_ready = cdc_acm_irq_tx_ready, diff --git a/tests/subsys/mgmt/ec_host_cmd/uart/src/uart_mock.c b/tests/subsys/mgmt/ec_host_cmd/uart/src/uart_mock.c index 705bc393cdb..59a35d0e8d8 100644 --- a/tests/subsys/mgmt/ec_host_cmd/uart/src/uart_mock.c +++ b/tests/subsys/mgmt/ec_host_cmd/uart/src/uart_mock.c @@ -59,7 +59,7 @@ static int uart_mock_rx_disable(const struct device *dev) return 0; } -static struct uart_driver_api mock_api = { +static DEVICE_API(uart, mock_api) = { .callback_set = uart_mock_callback_set, .tx = uart_mock_tx, .rx_enable = uart_mock_rx_enable,