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 <chengkai@xiaomi.com>
This commit is contained in:
chengkai 2024-01-04 20:00:28 +08:00 committed by Xiang Xiao
parent 3144971704
commit b66f1147e6
3 changed files with 20 additions and 22 deletions

View file

@ -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;
}

View file

@ -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

View file

@ -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;