From 86ee2f115207fd3ce83d32c8dba993cde3b17518 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Wed, 12 Feb 2025 09:24:15 +0100 Subject: [PATCH 1/6] drivers: dai: Wrap driver instances in device API macro Use the device API macro to place the driver API instance into an iterable section. Signed-off-by: Pieter De Gendt --- drivers/dai/nxp/micfil/micfil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dai/nxp/micfil/micfil.c b/drivers/dai/nxp/micfil/micfil.c index 7c20ef6f33f9..364be9ac28a9 100644 --- a/drivers/dai/nxp/micfil/micfil.c +++ b/drivers/dai/nxp/micfil/micfil.c @@ -159,7 +159,7 @@ static int dai_nxp_micfil_remove(const struct device *dev) return 0; } -const struct dai_driver_api dai_nxp_micfil_ops = { +static DEVICE_API(dai, dai_nxp_micfil_ops) = { .probe = dai_nxp_micfil_probe, .remove = dai_nxp_micfil_remove, .config_set = dai_nxp_micfil_set_config, From 7413a667ef3d2f4e0f2455d8ef2f2761eab29d39 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Wed, 12 Feb 2025 09:25:43 +0100 Subject: [PATCH 2/6] drivers: flash: Wrap driver instances in device API macro Use the device API macro to place the driver API instance into an iterable section. Signed-off-by: Pieter De Gendt --- drivers/flash/flash_andes_qspi.c | 2 +- drivers/flash/soc_flash_cc23x0.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/flash/flash_andes_qspi.c b/drivers/flash/flash_andes_qspi.c index 22196ae1a29f..d7d58a73ad02 100644 --- a/drivers/flash/flash_andes_qspi.c +++ b/drivers/flash/flash_andes_qspi.c @@ -902,7 +902,7 @@ flash_andes_qspi_get_parameters(const struct device *dev) return &config->parameters; } -static const struct flash_driver_api flash_andes_qspi_api = { +static DEVICE_API(flash, flash_andes_qspi_api) = { .read = flash_andes_qspi_read, .write = flash_andes_qspi_write, .erase = flash_andes_qspi_erase, diff --git a/drivers/flash/soc_flash_cc23x0.c b/drivers/flash/soc_flash_cc23x0.c index a3e686fda6b1..dbcbad776ae5 100644 --- a/drivers/flash/soc_flash_cc23x0.c +++ b/drivers/flash/soc_flash_cc23x0.c @@ -223,7 +223,7 @@ static void flash_cc23x0_layout(const struct device *dev, const struct flash_pag } #endif /* CONFIG_FLASH_PAGE_LAYOUT */ -static const struct flash_driver_api flash_cc23x0_api = { +static DEVICE_API(flash, flash_cc23x0_api) = { .erase = flash_cc23x0_erase, .write = flash_cc23x0_write, .read = flash_cc23x0_read, From 4b29e575118bb4aaf0b63c43eedf111c9b2b607e Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Wed, 12 Feb 2025 09:26:06 +0100 Subject: [PATCH 3/6] drivers: gpio: Wrap driver instances in device API macro Use the device API macro to place the driver API instance into an iterable section. Signed-off-by: Pieter De Gendt --- drivers/gpio/gpio_cc23x0.c | 2 +- drivers/gpio/gpio_mfxstm32l152.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio_cc23x0.c b/drivers/gpio/gpio_cc23x0.c index 643766e255d2..b39c7b3ec9db 100644 --- a/drivers/gpio/gpio_cc23x0.c +++ b/drivers/gpio/gpio_cc23x0.c @@ -256,7 +256,7 @@ static int gpio_cc23x0_init(const struct device *dev) return 0; } -static const struct gpio_driver_api gpio_cc23x0_driver_api = { +static DEVICE_API(gpio, gpio_cc23x0_driver_api) = { .pin_configure = gpio_cc23x0_config, #ifdef CONFIG_GPIO_GET_CONFIG .pin_get_config = gpio_cc23x0_get_config, diff --git a/drivers/gpio/gpio_mfxstm32l152.c b/drivers/gpio/gpio_mfxstm32l152.c index ede0740df8d4..bf2e57c138a7 100644 --- a/drivers/gpio/gpio_mfxstm32l152.c +++ b/drivers/gpio/gpio_mfxstm32l152.c @@ -612,7 +612,7 @@ static int mfxstm32l152_init(const struct device *dev) return ret; } -static const struct gpio_driver_api mfxstm32l152_drv_api = { +static DEVICE_API(gpio, mfxstm32l152_drv_api) = { .pin_configure = mfxstm32l152_configure, .port_get_raw = mfxstm32l152_port_get_raw, .port_set_masked_raw = NULL, From 7e502fe2523b41274da17aa3d648555eada72407 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Wed, 12 Feb 2025 09:26:30 +0100 Subject: [PATCH 4/6] drivers: mbox: Wrap driver instances in device API macro Use the device API macro to place the driver API instance into an iterable section. Signed-off-by: Pieter De Gendt --- drivers/mbox/mbox_ti_omap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mbox/mbox_ti_omap.c b/drivers/mbox/mbox_ti_omap.c index b75a88b70be9..847d9106282c 100644 --- a/drivers/mbox/mbox_ti_omap.c +++ b/drivers/mbox/mbox_ti_omap.c @@ -199,7 +199,7 @@ static int omap_mailbox_set_enabled(const struct device *dev, uint32_t channel, return 0; } -static const struct mbox_driver_api omap_mailbox_driver_api = { +static DEVICE_API(mbox, omap_mailbox_driver_api) = { .send = omap_mailbox_send, .register_callback = omap_mailbox_register_callback, .mtu_get = omap_mailbox_mtu_get, From 9285196ea2bc182a97f067206c56ab72d12c5038 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Wed, 12 Feb 2025 09:26:50 +0100 Subject: [PATCH 5/6] drivers: rtc: Wrap driver instances in device API macro Use the device API macro to place the driver API instance into an iterable section. Signed-off-by: Pieter De Gendt --- drivers/rtc/rtc_sam0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/rtc_sam0.c b/drivers/rtc/rtc_sam0.c index 3295a8efd86c..a6dc578a01da 100644 --- a/drivers/rtc/rtc_sam0.c +++ b/drivers/rtc/rtc_sam0.c @@ -552,7 +552,7 @@ static int rtc_sam0_init(const struct device *dev) return 0; } -static const struct rtc_driver_api rtc_sam0_driver_api = { +static DEVICE_API(rtc, rtc_sam0_driver_api) = { .set_time = rtc_sam0_set_time, .get_time = rtc_sam0_get_time, #ifdef CONFIG_RTC_ALARM From b4c97bf3e115c7b3042360be40ca9825d8218412 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Wed, 12 Feb 2025 09:27:09 +0100 Subject: [PATCH 6/6] drivers: serial: Wrap driver instances in device API macro Use the device API macro to place the driver API instance into an iterable section. Signed-off-by: Pieter De Gendt --- drivers/serial/uart_cc23x0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/serial/uart_cc23x0.c b/drivers/serial/uart_cc23x0.c index 5576871aacac..c26bb40e59fc 100644 --- a/drivers/serial/uart_cc23x0.c +++ b/drivers/serial/uart_cc23x0.c @@ -307,7 +307,7 @@ static void uart_cc23x0_isr(const struct device *dev) #endif /* CONFIG_UART_INTERRUPT_DRIVEN */ -static const struct uart_driver_api uart_cc23x0_driver_api = { +static DEVICE_API(uart, uart_cc23x0_driver_api) = { .poll_in = uart_cc23x0_poll_in, .poll_out = uart_cc23x0_poll_out, .err_check = uart_cc23x0_err_check,