From e9e64bab3540efaa706aff2e350528c2cac09121 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Wed, 27 Nov 2024 13:03:38 +0100 Subject: [PATCH] drivers: bluetooth: hci: Place API into iterable section Add wrapper DEVICE_API macro to all bt_hci_driver_api instances. Signed-off-by: Pieter De Gendt --- drivers/bluetooth/hci/h4.c | 2 +- drivers/bluetooth/hci/h5.c | 2 +- drivers/bluetooth/hci/hci_ambiq.c | 2 +- drivers/bluetooth/hci/hci_da1469x.c | 2 +- drivers/bluetooth/hci/hci_esp32.c | 2 +- drivers/bluetooth/hci/hci_ifx_cyw208xx.c | 2 +- drivers/bluetooth/hci/hci_ifx_psoc6_bless.c | 2 +- drivers/bluetooth/hci/hci_nxp.c | 2 +- drivers/bluetooth/hci/hci_silabs_efr32.c | 2 +- drivers/bluetooth/hci/hci_spi_st.c | 2 +- drivers/bluetooth/hci/hci_stm32wb0.c | 2 +- drivers/bluetooth/hci/hci_stm32wba.c | 2 +- drivers/bluetooth/hci/ipc.c | 2 +- drivers/bluetooth/hci/ipm_stm32wb.c | 2 +- drivers/bluetooth/hci/spi.c | 2 +- drivers/bluetooth/hci/userchan.c | 2 +- subsys/bluetooth/controller/hci/hci_driver.c | 2 +- tests/bluetooth/bluetooth/src/bluetooth.c | 2 +- tests/bluetooth/hci_prop_evt/src/main.c | 2 +- tests/bluetooth/hci_uart_async/src/test_hci_uart_async.c | 2 +- tests/bluetooth/host_long_adv_recv/src/main.c | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/bluetooth/hci/h4.c b/drivers/bluetooth/hci/h4.c index a37eb7fd165..4ca495e2abe 100644 --- a/drivers/bluetooth/hci/h4.c +++ b/drivers/bluetooth/hci/h4.c @@ -564,7 +564,7 @@ static int h4_setup(const struct device *dev, const struct bt_hci_setup_params * } #endif -static const struct bt_hci_driver_api h4_driver_api = { +static DEVICE_API(bt_hci, h4_driver_api) = { .open = h4_open, .send = h4_send, #if defined(CONFIG_BT_HCI_SETUP) diff --git a/drivers/bluetooth/hci/h5.c b/drivers/bluetooth/hci/h5.c index ae75088b997..805f14c5a2d 100644 --- a/drivers/bluetooth/hci/h5.c +++ b/drivers/bluetooth/hci/h5.c @@ -801,7 +801,7 @@ static int h5_open(const struct device *dev, bt_hci_recv_t recv) return 0; } -static const struct bt_hci_driver_api h5_driver_api = { +static DEVICE_API(bt_hci, h5_driver_api) = { .open = h5_open, .send = h5_queue, }; diff --git a/drivers/bluetooth/hci/hci_ambiq.c b/drivers/bluetooth/hci/hci_ambiq.c index a0013909449..150313b2c78 100644 --- a/drivers/bluetooth/hci/hci_ambiq.c +++ b/drivers/bluetooth/hci/hci_ambiq.c @@ -422,7 +422,7 @@ static int bt_apollo_setup(const struct device *dev, const struct bt_hci_setup_p return ret; } -static const struct bt_hci_driver_api drv = { +static DEVICE_API(bt_hci, drv) = { .open = bt_apollo_open, .close = bt_apollo_close, .send = bt_apollo_send, diff --git a/drivers/bluetooth/hci/hci_da1469x.c b/drivers/bluetooth/hci/hci_da1469x.c index 8ffbb1b5ad2..cbf09327188 100644 --- a/drivers/bluetooth/hci/hci_da1469x.c +++ b/drivers/bluetooth/hci/hci_da1469x.c @@ -495,7 +495,7 @@ static int bt_da1469x_send(const struct device *dev, struct net_buf *buf) return 0; } -static const struct bt_hci_driver_api drv = { +static DEVICE_API(bt_hci, drv) = { .open = bt_da1469x_open, .close = bt_da1469x_close, .send = bt_da1469x_send, diff --git a/drivers/bluetooth/hci/hci_esp32.c b/drivers/bluetooth/hci/hci_esp32.c index 89597b06179..58b16e82431 100644 --- a/drivers/bluetooth/hci/hci_esp32.c +++ b/drivers/bluetooth/hci/hci_esp32.c @@ -362,7 +362,7 @@ static int bt_esp32_close(const struct device *dev) return 0; } -static const struct bt_hci_driver_api drv = { +static DEVICE_API(bt_hci, drv) = { .open = bt_esp32_open, .send = bt_esp32_send, .close = bt_esp32_close, diff --git a/drivers/bluetooth/hci/hci_ifx_cyw208xx.c b/drivers/bluetooth/hci/hci_ifx_cyw208xx.c index 9146bd581ab..b64eaa09885 100644 --- a/drivers/bluetooth/hci/hci_ifx_cyw208xx.c +++ b/drivers/bluetooth/hci/hci_ifx_cyw208xx.c @@ -299,7 +299,7 @@ done: return ret ? -EIO : 0; } -static const struct bt_hci_driver_api drv = { +static DEVICE_API(bt_hci, drv) = { .open = cyw208xx_open, .close = cyw208xx_close, .send = cyw208xx_send, diff --git a/drivers/bluetooth/hci/hci_ifx_psoc6_bless.c b/drivers/bluetooth/hci/hci_ifx_psoc6_bless.c index 4c575c1d29b..7c36dd8a08e 100644 --- a/drivers/bluetooth/hci/hci_ifx_psoc6_bless.c +++ b/drivers/bluetooth/hci/hci_ifx_psoc6_bless.c @@ -265,7 +265,7 @@ static int psoc6_bless_hci_init(const struct device *dev) return 0; } -static const struct bt_hci_driver_api drv = { +static DEVICE_API(bt_hci, drv) = { .open = psoc6_bless_open, .send = psoc6_bless_send, .setup = psoc6_bless_setup, diff --git a/drivers/bluetooth/hci/hci_nxp.c b/drivers/bluetooth/hci/hci_nxp.c index da15356d637..366325539f0 100644 --- a/drivers/bluetooth/hci/hci_nxp.c +++ b/drivers/bluetooth/hci/hci_nxp.c @@ -532,7 +532,7 @@ static int bt_nxp_close(const struct device *dev) return ret; } -static const struct bt_hci_driver_api drv = { +static DEVICE_API(bt_hci, drv) = { .open = bt_nxp_open, .setup = bt_nxp_setup, .close = bt_nxp_close, diff --git a/drivers/bluetooth/hci/hci_silabs_efr32.c b/drivers/bluetooth/hci/hci_silabs_efr32.c index bd0fe0c0af7..49d69098db3 100644 --- a/drivers/bluetooth/hci/hci_silabs_efr32.c +++ b/drivers/bluetooth/hci/hci_silabs_efr32.c @@ -252,7 +252,7 @@ void sl_bt_controller_init(void) /* No extra initialization procedure required */ } -static const struct bt_hci_driver_api drv = { +static DEVICE_API(bt_hci, drv) = { .open = slz_bt_open, .send = slz_bt_send, }; diff --git a/drivers/bluetooth/hci/hci_spi_st.c b/drivers/bluetooth/hci/hci_spi_st.c index cc4d7f8b9d0..4b8e25fe43d 100644 --- a/drivers/bluetooth/hci/hci_spi_st.c +++ b/drivers/bluetooth/hci/hci_spi_st.c @@ -693,7 +693,7 @@ static int bt_spi_open(const struct device *dev, bt_hci_recv_t recv) return 0; } -static const struct bt_hci_driver_api drv = { +static DEVICE_API(bt_hci, drv) = { #if defined(CONFIG_BT_BLUENRG_ACI) && !defined(CONFIG_BT_HCI_RAW) .setup = bt_spi_bluenrg_setup, #endif /* CONFIG_BT_BLUENRG_ACI && !CONFIG_BT_HCI_RAW */ diff --git a/drivers/bluetooth/hci/hci_stm32wb0.c b/drivers/bluetooth/hci/hci_stm32wb0.c index b47de037a2d..70a9282c0e0 100644 --- a/drivers/bluetooth/hci/hci_stm32wb0.c +++ b/drivers/bluetooth/hci/hci_stm32wb0.c @@ -488,7 +488,7 @@ static int bt_hci_stm32wb0_open(const struct device *dev, bt_hci_recv_t recv) return 0; } -static const struct bt_hci_driver_api drv = { +static DEVICE_API(bt_hci, drv) = { .open = bt_hci_stm32wb0_open, .send = bt_hci_stm32wb0_send, }; diff --git a/drivers/bluetooth/hci/hci_stm32wba.c b/drivers/bluetooth/hci/hci_stm32wba.c index 490f2b7258b..2c63ece3f55 100644 --- a/drivers/bluetooth/hci/hci_stm32wba.c +++ b/drivers/bluetooth/hci/hci_stm32wba.c @@ -474,7 +474,7 @@ static int bt_hci_stm32wba_setup(const struct device *dev, } #endif /* CONFIG_BT_HCI_SETUP */ -static const struct bt_hci_driver_api drv = { +static DEVICE_API(bt_hci, drv) = { #if defined(CONFIG_BT_HCI_SETUP) .setup = bt_hci_stm32wba_setup, #endif diff --git a/drivers/bluetooth/hci/ipc.c b/drivers/bluetooth/hci/ipc.c index 9d63d12ec32..d25f7c8af10 100644 --- a/drivers/bluetooth/hci/ipc.c +++ b/drivers/bluetooth/hci/ipc.c @@ -379,7 +379,7 @@ static int bt_ipc_close(const struct device *dev) return 0; } -static const struct bt_hci_driver_api drv = { +static DEVICE_API(bt_hci, drv) = { .open = bt_ipc_open, .close = bt_ipc_close, .send = bt_ipc_send, diff --git a/drivers/bluetooth/hci/ipm_stm32wb.c b/drivers/bluetooth/hci/ipm_stm32wb.c index f476083dc8c..805d9079c21 100644 --- a/drivers/bluetooth/hci/ipm_stm32wb.c +++ b/drivers/bluetooth/hci/ipm_stm32wb.c @@ -618,7 +618,7 @@ static int bt_ipm_close(const struct device *dev) } #endif /* CONFIG_BT_HCI_HOST */ -static const struct bt_hci_driver_api drv = { +static DEVICE_API(bt_hci, drv) = { .open = bt_ipm_open, #ifdef CONFIG_BT_HCI_HOST .close = bt_ipm_close, diff --git a/drivers/bluetooth/hci/spi.c b/drivers/bluetooth/hci/spi.c index 05e46a1d182..6ef19929235 100644 --- a/drivers/bluetooth/hci/spi.c +++ b/drivers/bluetooth/hci/spi.c @@ -420,7 +420,7 @@ static int bt_spi_open(const struct device *dev, bt_hci_recv_t recv) return 0; } -static const struct bt_hci_driver_api drv = { +static DEVICE_API(bt_hci, drv) = { .open = bt_spi_open, .send = bt_spi_send, }; diff --git a/drivers/bluetooth/hci/userchan.c b/drivers/bluetooth/hci/userchan.c index aedb71a8430..50c3165809d 100644 --- a/drivers/bluetooth/hci/userchan.c +++ b/drivers/bluetooth/hci/userchan.c @@ -405,7 +405,7 @@ static int uc_open(const struct device *dev, bt_hci_recv_t recv) return 0; } -static const struct bt_hci_driver_api uc_drv_api = { +static DEVICE_API(bt_hci, uc_drv_api) = { .open = uc_open, .send = uc_send, }; diff --git a/subsys/bluetooth/controller/hci/hci_driver.c b/subsys/bluetooth/controller/hci/hci_driver.c index aa2bdb0c20c..0a655537a4a 100644 --- a/subsys/bluetooth/controller/hci/hci_driver.c +++ b/subsys/bluetooth/controller/hci/hci_driver.c @@ -900,7 +900,7 @@ static int hci_driver_close(const struct device *dev) return 0; } -static const struct bt_hci_driver_api hci_driver_api = { +static DEVICE_API(bt_hci, hci_driver_api) = { .open = hci_driver_open, .close = hci_driver_close, .send = hci_driver_send, diff --git a/tests/bluetooth/bluetooth/src/bluetooth.c b/tests/bluetooth/bluetooth/src/bluetooth.c index 92889f9b598..4c81e7526d7 100644 --- a/tests/bluetooth/bluetooth/src/bluetooth.c +++ b/tests/bluetooth/bluetooth/src/bluetooth.c @@ -35,7 +35,7 @@ static int driver_send(const struct device *dev, struct net_buf *buf) return 0; } -static const struct bt_hci_driver_api driver_api = { +static DEVICE_API(bt_hci, driver_api) = { .open = driver_open, .send = driver_send, }; diff --git a/tests/bluetooth/hci_prop_evt/src/main.c b/tests/bluetooth/hci_prop_evt/src/main.c index ea433b62df4..9791ef77dbd 100644 --- a/tests/bluetooth/hci_prop_evt/src/main.c +++ b/tests/bluetooth/hci_prop_evt/src/main.c @@ -235,7 +235,7 @@ static int driver_send(const struct device *dev, struct net_buf *buf) return 0; } -static const struct bt_hci_driver_api driver_api = { +static DEVICE_API(bt_hci, driver_api) = { .open = driver_open, .send = driver_send, }; diff --git a/tests/bluetooth/hci_uart_async/src/test_hci_uart_async.c b/tests/bluetooth/hci_uart_async/src/test_hci_uart_async.c index d30503ce216..acdb5c1a48f 100644 --- a/tests/bluetooth/hci_uart_async/src/test_hci_uart_async.c +++ b/tests/bluetooth/hci_uart_async/src/test_hci_uart_async.c @@ -37,7 +37,7 @@ static void serial_vnd_data_callback(const struct device *dev, void *user_data); static int drv_send(const struct device *dev, struct net_buf *buf); static int drv_open(const struct device *dev, bt_hci_recv_t recv); -static const struct bt_hci_driver_api drv_api = { +static DEVICE_API(bt_hci, drv_api) = { .open = drv_open, .send = drv_send, }; diff --git a/tests/bluetooth/host_long_adv_recv/src/main.c b/tests/bluetooth/host_long_adv_recv/src/main.c index 71769be589d..b31d55fc83b 100644 --- a/tests/bluetooth/host_long_adv_recv/src/main.c +++ b/tests/bluetooth/host_long_adv_recv/src/main.c @@ -249,7 +249,7 @@ static int driver_send(const struct device *dev, struct net_buf *buf) return 0; } -static const struct bt_hci_driver_api driver_api = { +static DEVICE_API(bt_hci, driver_api) = { .open = driver_open, .send = driver_send, };