From 3187dde36cba508a159bd6fdcb868e1794367c8f Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Tue, 31 Dec 2019 09:30:44 -0600 Subject: [PATCH] fix sim:bluetooth compiler error (#18) wireless/bluetooth/bt_null.c:274:10: warning: implicit declaration of function 'bt_driver_register'; did you mean 'bt_netdev_register'? [-Wimplicit-function-declaration] return bt_driver_register(&g_bt_null); sim_bringup.c:324:9: error: too few arguments to function 'bt_netdev_register' ret = bt_netdev_register(); --- boards/sim/sim/sim/src/sim_bringup.c | 18 ++---------------- drivers/wireless/bluetooth/bt_null.c | 2 +- drivers/wireless/bluetooth/bt_uart_bcm4343x.c | 2 +- drivers/wireless/bluetooth/bt_uart_cc2564.c | 2 +- drivers/wireless/bluetooth/bt_uart_generic.c | 2 +- 5 files changed, 6 insertions(+), 20 deletions(-) diff --git a/boards/sim/sim/sim/src/sim_bringup.c b/boards/sim/sim/sim/src/sim_bringup.c index edb3782e45..1011853b9c 100644 --- a/boards/sim/sim/sim/src/sim_bringup.c +++ b/boards/sim/sim/sim/src/sim_bringup.c @@ -79,7 +79,7 @@ int sim_bringup(void) #ifdef CONFIG_RAMMTD FAR uint8_t *ramstart; #endif - int ret; + int ret = OK; #ifdef CONFIG_FS_BINFS /* Mount the binfs file system */ @@ -300,7 +300,6 @@ int sim_bringup(void) } #endif -#ifdef CONFIG_WIRELESS_BLUETOOTH #ifdef CONFIG_BLUETOOTH_NULL /* Register the NULL Bluetooth network device */ @@ -311,18 +310,5 @@ int sim_bringup(void) } #endif - /* Initialize the Bluetooth stack (This will fail if no device has been - * registered). - */ - - ret = bt_netdev_register(); - if (ret < 0) - { - syslog(LOG_ERR, "ERROR: bt_netdev_register() failed: %d\n", ret); - } - -#endif - - UNUSED(ret); - return OK; + return ret; } diff --git a/drivers/wireless/bluetooth/bt_null.c b/drivers/wireless/bluetooth/bt_null.c index 114152a062..307d204974 100644 --- a/drivers/wireless/bluetooth/bt_null.c +++ b/drivers/wireless/bluetooth/bt_null.c @@ -271,5 +271,5 @@ int btnull_register(void) { /* Register the driver with the Bluetooth stack */ - return bt_driver_register(&g_bt_null); + return bt_netdev_register(&g_bt_null); } diff --git a/drivers/wireless/bluetooth/bt_uart_bcm4343x.c b/drivers/wireless/bluetooth/bt_uart_bcm4343x.c index 49e3601f7a..60d890727d 100644 --- a/drivers/wireless/bluetooth/bt_uart_bcm4343x.c +++ b/drivers/wireless/bluetooth/bt_uart_bcm4343x.c @@ -471,7 +471,7 @@ int btuart_register(FAR const struct btuart_lowerhalf_s *lower) ret = bt_netdev_register(&upper->dev); if (ret < 0) { - wlerr("ERROR: bt_driver_register failed: %d\n", ret); + wlerr("ERROR: bt_netdev_register failed: %d\n", ret); kmm_free(upper); } diff --git a/drivers/wireless/bluetooth/bt_uart_cc2564.c b/drivers/wireless/bluetooth/bt_uart_cc2564.c index dd33d5d6de..7983cf35e2 100644 --- a/drivers/wireless/bluetooth/bt_uart_cc2564.c +++ b/drivers/wireless/bluetooth/bt_uart_cc2564.c @@ -216,7 +216,7 @@ int btuart_register(FAR const struct btuart_lowerhalf_s *lower) ret = bt_netdev_register(&upper->dev); if (ret < 0) { - wlerr("ERROR: bt_driver_register failed: %d\n", ret); + wlerr("ERROR: bt_netdev_register failed: %d\n", ret); kmm_free(upper); } diff --git a/drivers/wireless/bluetooth/bt_uart_generic.c b/drivers/wireless/bluetooth/bt_uart_generic.c index e0ca43acc6..2d31b41180 100644 --- a/drivers/wireless/bluetooth/bt_uart_generic.c +++ b/drivers/wireless/bluetooth/bt_uart_generic.c @@ -110,7 +110,7 @@ int btuart_register(FAR const struct btuart_lowerhalf_s *lower) ret = bt_netdev_register(&upper->dev); if (ret < 0) { - wlerr("ERROR: bt_driver_register failed: %d\n", ret); + wlerr("ERROR: bt_netdev_registe failed: %d\n", ret); kmm_free(upper); }