bt_uart_shim: Correct the prototype of bt_uart_shim_getdevice

1.Add const to the path argument
2.Return the explicit type(struct btuart_lowerhalf_s *)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2020-12-27 02:53:32 +08:00
committed by Alin Jerpelea
parent d85cf99a65
commit aec3220fae
2 changed files with 4 additions and 6 deletions
+2 -3
View File
@@ -58,7 +58,6 @@
#include <nuttx/kthread.h> #include <nuttx/kthread.h>
#include <nuttx/semaphore.h> #include <nuttx/semaphore.h>
#include <nuttx/serial/tioctl.h> #include <nuttx/serial/tioctl.h>
#include <nuttx/wireless/bluetooth/bt_uart.h>
#include <nuttx/wireless/bluetooth/bt_uart_shim.h> #include <nuttx/wireless/bluetooth/bt_uart_shim.h>
#include <termios.h> #include <termios.h>
@@ -431,7 +430,7 @@ static int hcicollecttask(int argc, FAR char **argv)
* *
****************************************************************************/ ****************************************************************************/
FAR void *bt_uart_shim_getdevice(FAR char *path) FAR struct btuart_lowerhalf_s *bt_uart_shim_getdevice(FAR const char *path)
{ {
FAR struct hciuart_state_s *s; FAR struct hciuart_state_s *s;
int ret; int ret;
@@ -474,5 +473,5 @@ FAR void *bt_uart_shim_getdevice(FAR char *path)
CONFIG_BLUETOOTH_TXCONN_PRIORITY, CONFIG_BLUETOOTH_TXCONN_PRIORITY,
1024, hcicollecttask, NULL); 1024, hcicollecttask, NULL);
return g_n; return (FAR struct btuart_lowerhalf_s *)g_n;
} }
@@ -41,8 +41,7 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/wireless/bluetooth/bt_uart.h>
#include <nuttx/compiler.h>
#ifdef CONFIG_BLUETOOTH_UART_SHIM #ifdef CONFIG_BLUETOOTH_UART_SHIM
@@ -50,7 +49,7 @@
* Public Function Prototypes * Public Function Prototypes
****************************************************************************/ ****************************************************************************/
FAR void *bt_uart_shim_getdevice(FAR char *path); FAR struct btuart_lowerhalf_s *bt_uart_shim_getdevice(FAR const char *path);
#endif #endif
#endif #endif