wireless/bluetooth: replace open with file_open in uart shim drivers
it is simpler than open and then file_detach Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: I22585b7450804c6c012fecf369a8d7e25970c192
This commit is contained in:
parent
f193f0f702
commit
eacca2b7a2
@ -434,7 +434,7 @@ static int hcicollecttask(int argc, FAR char **argv)
|
||||
FAR void *bt_uart_shim_getdevice(FAR char *path)
|
||||
{
|
||||
FAR struct hciuart_state_s *s;
|
||||
int f2;
|
||||
int ret;
|
||||
|
||||
/* Get the memory for this shim instance */
|
||||
|
||||
@ -448,19 +448,14 @@ FAR void *bt_uart_shim_getdevice(FAR char *path)
|
||||
|
||||
s = &g_n->state;
|
||||
|
||||
f2 = open(path, O_RDWR | O_BINARY);
|
||||
|
||||
if (f2 < 0)
|
||||
ret = file_open(&s->f, path, O_RDWR | O_BINARY);
|
||||
if (ret < 0)
|
||||
{
|
||||
kmm_free(g_n);
|
||||
g_n = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Detach the file and give it somewhere to be kept */
|
||||
|
||||
s->h = file_detach(f2, &s->f);
|
||||
|
||||
/* Hook the routines in */
|
||||
|
||||
memcpy(&g_n->lower, &g_lowerstatic, sizeof(struct btuart_lowerhalf_s));
|
||||
|
Loading…
Reference in New Issue
Block a user