This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit b66f1147e642dfde85704aae2cc2af92b24f993c
Author: chengkai <[email protected]>
AuthorDate: Thu Jan 4 20:00:28 2024 +0800

    bluetooth: set bt_driver_register/unregister to xx_set/unset
    
    change bt_driver_register/unregister function name to
    bt_driver_set/unset, which would be prepared for bt_driver.h
    
    Signed-off-by: chengkai <[email protected]>
---
 wireless/bluetooth/bt_hcicore.c | 17 ++++++++---------
 wireless/bluetooth/bt_hcicore.h | 17 ++++++++---------
 wireless/bluetooth/bt_netdev.c  |  8 ++++----
 3 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/wireless/bluetooth/bt_hcicore.c b/wireless/bluetooth/bt_hcicore.c
index 44e3b05ab8..0a5587e379 100644
--- a/wireless/bluetooth/bt_hcicore.c
+++ b/wireless/bluetooth/bt_hcicore.c
@@ -1661,10 +1661,10 @@ int bt_deinitialize(void)
 }
 
 /****************************************************************************
- * Name: bt_driver_register
+ * Name: bt_driver_set
  *
  * Description:
- *   Register the Bluetooth low-level driver with the Bluetooth stack.
+ *   Set the Bluetooth low-level driver with the Bluetooth stack.
  *   This is called from the low-level driver and is part of the driver
  *   interface prototyped in include/nuttx/wireless/bluetooth/bt_driver.h
  *
@@ -1679,7 +1679,7 @@ int bt_deinitialize(void)
  *
  ****************************************************************************/
 
-int bt_driver_register(FAR struct bt_driver_s *btdev)
+int bt_driver_set(FAR struct bt_driver_s *btdev)
 {
   DEBUGASSERT(btdev != NULL && btdev->open != NULL && btdev->send != NULL);
 
@@ -1696,13 +1696,12 @@ int bt_driver_register(FAR struct bt_driver_s *btdev)
 }
 
 /****************************************************************************
- * Name: bt_driver_unregister
+ * Name: bt_driver_unset
  *
  * Description:
- *   Unregister a Bluetooth low-level driver previously registered with
- *   bt_driver_register.  This may be called from the low-level driver and
- *   is part of the driver interface prototyped in
- *   include/nuttx/wireless/bluetooth/bt_driver.h
+ *   Unset a Bluetooth low-level driver previously set with bt_driver_set.
+ *   This may be called from the low-level driver and is part of the driver
+ *   interface prototyped in include/nuttx/wireless/bluetooth/bt_driver.h
  *
  * Input Parameters:
  *   btdev - An instance of the low-level drivers interface structure.
@@ -1712,7 +1711,7 @@ int bt_driver_register(FAR struct bt_driver_s *btdev)
  *
  ****************************************************************************/
 
-void bt_driver_unregister(FAR struct bt_driver_s *btdev)
+void bt_driver_unset(FAR struct bt_driver_s *btdev)
 {
   g_btdev.btdev = NULL;
 }
diff --git a/wireless/bluetooth/bt_hcicore.h b/wireless/bluetooth/bt_hcicore.h
index e9609af743..7488a3d000 100644
--- a/wireless/bluetooth/bt_hcicore.h
+++ b/wireless/bluetooth/bt_hcicore.h
@@ -275,10 +275,10 @@ int bt_initialize(void);
 int bt_deinitialize(void);
 
 /****************************************************************************
- * Name: bt_driver_register
+ * Name: bt_driver_set
  *
  * Description:
- *   Register the Bluetooth low-level driver with the Bluetooth stack.
+ *   Set the Bluetooth low-level driver with the Bluetooth stack.
  *   This is called from the low-level driver and is part of the driver
  *   interface prototyped in include/nuttx/wireless/bluetooth/bt_driver.h
  *
@@ -293,16 +293,15 @@ int bt_deinitialize(void);
  *
  ****************************************************************************/
 
-int bt_driver_register(FAR struct bt_driver_s *btdev);
+int bt_driver_set(FAR struct bt_driver_s *btdev);
 
 /****************************************************************************
- * Name: bt_driver_unregister
+ * Name: bt_driver_unset
  *
  * Description:
- *   Unregister a Bluetooth low-level driver previously registered with
- *   bt_driver_register.  This may be called from the low-level driver and
- *   is part of the driver interface prototyped in
- *   include/nuttx/wireless/bluetooth/bt_driver.h
+ *   Unset a Bluetooth low-level driver previously set with bt_driver_set.
+ *   This may be called from the low-level driver and is part of the driver
+ *   interface prototyped in include/nuttx/wireless/bluetooth/bt_driver.h
  *
  * Input Parameters:
  *   btdev - An instance of the low-level drivers interface structure.
@@ -312,7 +311,7 @@ int bt_driver_register(FAR struct bt_driver_s *btdev);
  *
  ****************************************************************************/
 
-void bt_driver_unregister(FAR struct bt_driver_s *btdev);
+void bt_driver_unset(FAR struct bt_driver_s *btdev);
 
 /****************************************************************************
  * Name: bt_send
diff --git a/wireless/bluetooth/bt_netdev.c b/wireless/bluetooth/bt_netdev.c
index 4d7fecde31..897f11f6e6 100644
--- a/wireless/bluetooth/bt_netdev.c
+++ b/wireless/bluetooth/bt_netdev.c
@@ -1262,10 +1262,10 @@ int bt_netdev_register(FAR struct bt_driver_s *btdev)
    * supported.
    */
 
-  ret = bt_driver_register(btdev);
+  ret = bt_driver_set(btdev);
   if (ret < 0)
     {
-      nerr("ERROR: bt_driver_register() failed: %d\n", ret);
+      nerr("ERROR: bt_driver_set() failed: %d\n", ret);
       goto errout;
     }
 
@@ -1316,7 +1316,7 @@ int bt_netdev_register(FAR struct bt_driver_s *btdev)
 errout:
 
   btnet_ifdown(netdev);
-  bt_driver_unregister(btdev);
+  bt_driver_unset(btdev);
 
   /* Free memory and return the error */
 
@@ -1367,7 +1367,7 @@ int bt_netdev_unregister(FAR struct bt_driver_s *btdev)
 
   bt_deinitialize();
 
-  bt_driver_unregister(btdev);
+  bt_driver_unset(btdev);
 
   kmm_free(btdev->bt_net);
   btdev->bt_net = NULL;

Reply via email to